mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-22 12:16:31 +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: {
|
case EMPTY: {
|
||||||
if (ListInit *LHSl = dyn_cast<ListInit>(LHS)) {
|
if (ListInit *LHSl = dyn_cast<ListInit>(LHS)) {
|
||||||
if (LHSl->empty())
|
return IntInit::get(!!LHSl->empty());
|
||||||
return IntInit::get(1);
|
|
||||||
return IntInit::get(0);
|
|
||||||
}
|
}
|
||||||
if (StringInit *LHSs = dyn_cast<StringInit>(LHS)) {
|
if (StringInit *LHSs = dyn_cast<StringInit>(LHS)) {
|
||||||
if (LHSs->getValue().empty())
|
return IntInit::get(!!LHSs->getValue().empty());
|
||||||
return IntInit::get(1);
|
|
||||||
return IntInit::get(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -1134,9 +1130,8 @@ Init *TernOpInit::Fold(Record *CurRec, MultiClass *CurMultiClass) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case FOREACH: {
|
case FOREACH: {
|
||||||
Init *Result = ForeachHelper(LHS, MHS, RHS, getType(),
|
if (Init *Result = ForeachHelper(LHS, MHS, RHS, getType(),
|
||||||
CurRec, CurMultiClass);
|
CurRec, CurMultiClass))
|
||||||
if (Result)
|
|
||||||
return Result;
|
return Result;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user