[TableGen] Simplify some code. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237342 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Craig Topper 2015-05-14 05:53:59 +00:00
parent 1fbf73bae3
commit 8a049abf2f

View File

@ -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;
}