diff options
-rw-r--r-- | llvm/lib/TableGen/TGParser.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index a076966aff0..c373e2899a5 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -1147,9 +1147,9 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) { if (!InitList.back()) return nullptr; // All BinOps require their arguments to be of compatible types. - TypedInit *TI = dyn_cast<TypedInit>(InitList.back()); + RecTy *ListType = cast<TypedInit>(InitList.back())->getType(); if (!ArgType) { - ArgType = TI->getType(); + ArgType = ListType; switch (Code) { case BinOpInit::LISTCONCAT: @@ -1198,11 +1198,11 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) { default: llvm_unreachable("other ops have fixed argument types"); } } else { - RecTy *Resolved = resolveTypes(ArgType, TI->getType()); + RecTy *Resolved = resolveTypes(ArgType, ListType); if (!Resolved) { Error(InitLoc, Twine("expected value of type '") + - ArgType->getAsString() + "', got '" + - TI->getType()->getAsString() + "'"); + ArgType->getAsString() + "', got '" + + ListType->getAsString() + "'"); return nullptr; } if (Code != BinOpInit::ADD && Code != BinOpInit::AND && |