forked from OSchip/llvm-project
[TableGen] Fold a couple dyn_casts into the ifs that check their results. NFC
llvm-svn: 236088
This commit is contained in:
parent
ed5a950808
commit
39ba33b8f0
|
@ -1007,21 +1007,18 @@ static Init *ForeachHelper(Init *LHS, Init *MHS, Init *RHS, RecTy *Type,
|
||||||
static Init *EvaluateOperation(OpInit *RHSo, Init *LHS, Init *Arg,
|
static Init *EvaluateOperation(OpInit *RHSo, Init *LHS, Init *Arg,
|
||||||
RecTy *Type, Record *CurRec,
|
RecTy *Type, Record *CurRec,
|
||||||
MultiClass *CurMultiClass) {
|
MultiClass *CurMultiClass) {
|
||||||
std::vector<Init *> NewOperands;
|
|
||||||
|
|
||||||
TypedInit *TArg = dyn_cast<TypedInit>(Arg);
|
|
||||||
|
|
||||||
// If this is a dag, recurse
|
// If this is a dag, recurse
|
||||||
if (TArg && TArg->getType()->getAsString() == "dag") {
|
if (TypedInit *TArg = dyn_cast<TypedInit>(Arg)) {
|
||||||
Init *Result = ForeachHelper(LHS, Arg, RHSo, Type,
|
if (TArg->getType()->getAsString() == "dag") {
|
||||||
CurRec, CurMultiClass);
|
Init *Result = ForeachHelper(LHS, Arg, RHSo, Type,
|
||||||
return Result;
|
CurRec, CurMultiClass);
|
||||||
|
return Result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<Init *> NewOperands;
|
||||||
for (int i = 0; i < RHSo->getNumOperands(); ++i) {
|
for (int i = 0; i < RHSo->getNumOperands(); ++i) {
|
||||||
OpInit *RHSoo = dyn_cast<OpInit>(RHSo->getOperand(i));
|
if (OpInit *RHSoo = dyn_cast<OpInit>(RHSo->getOperand(i))) {
|
||||||
|
|
||||||
if (RHSoo) {
|
|
||||||
Init *Result = EvaluateOperation(RHSoo, LHS, Arg,
|
Init *Result = EvaluateOperation(RHSoo, LHS, Arg,
|
||||||
Type, CurRec, CurMultiClass);
|
Type, CurRec, CurMultiClass);
|
||||||
if (Result) {
|
if (Result) {
|
||||||
|
|
Loading…
Reference in New Issue