mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-04 06:09:05 +00:00
[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:
parent
1fbf73bae3
commit
8a049abf2f
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user