summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2015-05-14 05:53:59 +0000
committerCraig Topper <craig.topper@gmail.com>2015-05-14 05:53:59 +0000
commit42467f25e472dee979b82f6dda815915a00f2e78 (patch)
tree8dcf20a4df4444d47f13ddbc36cbf78dce0dc4f2 /llvm/lib/TableGen
parentbe91e627d996bbdd4f10a642cac05be6f06c31cc (diff)
downloadbcm5719-llvm-42467f25e472dee979b82f6dda815915a00f2e78.tar.gz
bcm5719-llvm-42467f25e472dee979b82f6dda815915a00f2e78.zip
[TableGen] Simplify some code. NFC
llvm-svn: 237342
Diffstat (limited to 'llvm/lib/TableGen')
-rw-r--r--llvm/lib/TableGen/Record.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index 9c8a06f2b5f..a9229175b7a 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -794,14 +794,10 @@ Init *UnOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const {
}
case EMPTY: {
if (ListInit *LHSl = dyn_cast<ListInit>(LHS)) {
- if (LHSl->empty())
- return IntInit::get(1);
- return IntInit::get(0);
+ return IntInit::get(!!LHSl->empty());
}
if (StringInit *LHSs = dyn_cast<StringInit>(LHS)) {
- if (LHSs->getValue().empty())
- return IntInit::get(1);
- return IntInit::get(0);
+ return IntInit::get(!!LHSs->getValue().empty());
}
break;
@@ -1134,9 +1130,8 @@ Init *TernOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const {
}
case FOREACH: {
- Init *Result = ForeachHelper(LHS, MHS, RHS, getType(),
- CurRec, CurMultiClass);
- if (Result)
+ if (Init *Result = ForeachHelper(LHS, MHS, RHS, getType(),
+ CurRec, CurMultiClass))
return Result;
break;
}
OpenPOWER on IntegriCloud