summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen/Record.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2014-06-19 06:10:58 +0000
committerCraig Topper <craig.topper@gmail.com>2014-06-19 06:10:58 +0000
commit35b2f75733c98e5904c5a75f8bcedeb96c4f4eda (patch)
tree6bc77166e70e62a9afed3fd9b00beab50a4ea99d /llvm/lib/TableGen/Record.cpp
parent8e34ecb797751925e24c3a006d811c3d28887c59 (diff)
downloadbcm5719-llvm-35b2f75733c98e5904c5a75f8bcedeb96c4f4eda.tar.gz
bcm5719-llvm-35b2f75733c98e5904c5a75f8bcedeb96c4f4eda.zip
Convert some assert(0) to llvm_unreachable or fold an 'if' condition into the assert.
llvm-svn: 211254
Diffstat (limited to 'llvm/lib/TableGen/Record.cpp')
-rw-r--r--llvm/lib/TableGen/Record.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index c553a21c261..f7843dc8360 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud