diff options
author | Craig Topper <craig.topper@gmail.com> | 2014-06-19 06:10:58 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2014-06-19 06:10:58 +0000 |
commit | bd01df2487e451fcdac23875f2a101b8e93fbe6e (patch) | |
tree | a934bc910cfd97051ee218e3cf0ce8521d667a79 /lib/TableGen | |
parent | 64429cefba00547d37b50383536a62047fd93380 (diff) | |
download | llvm-bd01df2487e451fcdac23875f2a101b8e93fbe6e.tar.gz llvm-bd01df2487e451fcdac23875f2a101b8e93fbe6e.tar.bz2 llvm-bd01df2487e451fcdac23875f2a101b8e93fbe6e.tar.xz |
Convert some assert(0) to llvm_unreachable or fold an 'if' condition into the assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/TableGen')
-rw-r--r-- | lib/TableGen/Record.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index c553a21c26..f7843dc836 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -811,20 +811,14 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const { } case HEAD: { if (ListInit *LHSl = dyn_cast<ListInit>(LHS)) { - if (LHSl->getSize() == 0) { - assert(0 && "Empty list in car"); - return nullptr; - } + assert(LHSl->getSize() != 0 && "Empty list in car"); return LHSl->getElement(0); } break; } case TAIL: { if (ListInit *LHSl = dyn_cast<ListInit>(LHS)) { - if (LHSl->getSize() == 0) { - assert(0 && "Empty list in cdr"); - return nullptr; - } + assert(LHSl->getSize() != 0 && "Empty list in cdr"); // Note the +1. We can't just pass the result of getValues() // directly. ArrayRef<Init *>::iterator begin = LHSl->getValues().begin()+1; |