mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-21 01:06:46 +00:00
[TableGen] Fold a couple dyn_casts into the ifs that check their results. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236088 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
134e2e75b3
commit
ac9abe5e99
@ -1007,21 +1007,18 @@ static Init *ForeachHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type,
|
||||
static Init *EvaluateOperation(OpInit *RHSo, Init *LHS, Init *Arg,
|
||||
RecTy *Type, Record *CurRec,
|
||||
MultiClass *CurMultiClass) {
|
||||
std::vector<Init *> NewOperands;
|
||||
|
||||
TypedInit *TArg = dyn_cast<TypedInit>(Arg);
|
||||
|
||||
// If this is a dag, recurse
|
||||
if (TArg && TArg->getType()->getAsString() == "dag") {
|
||||
Init *Result = ForeachHelper(LHS, Arg, RHSo, Type,
|
||||
CurRec, CurMultiClass);
|
||||
return Result;
|
||||
if (TypedInit *TArg = dyn_cast<TypedInit>(Arg)) {
|
||||
if (TArg->getType()->getAsString() == "dag") {
|
||||
Init *Result = ForeachHelper(LHS, Arg, RHSo, Type,
|
||||
CurRec, CurMultiClass);
|
||||
return Result;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<Init *> NewOperands;
|
||||
for (int i = 0; i < RHSo->getNumOperands(); ++i) {
|
||||
OpInit *RHSoo = dyn_cast<OpInit>(RHSo->getOperand(i));
|
||||
|
||||
if (RHSoo) {
|
||||
if (OpInit *RHSoo = dyn_cast<OpInit>(RHSo->getOperand(i))) {
|
||||
Init *Result = EvaluateOperation(RHSoo, LHS, Arg,
|
||||
Type, CurRec, CurMultiClass);
|
||||
if (Result) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user