From e4a2cf5761fef90c228a2d90c6f1fefa986561c8 Mon Sep 17 00:00:00 2001 From: Nicolai Haehnle Date: Thu, 22 Feb 2018 15:26:28 +0000 Subject: TableGen: Generalize type deduction for !listconcat Summary: This way, it should work even with complex operands. Change-Id: Iaccf5bbb50bd5882a0ba5d59689e4381315fb361 Reviewers: arsenm, craig.topper, tra, MartinO Subscribers: wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D43554 llvm-svn: 325796 --- llvm/lib/TableGen/TGParser.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'llvm/lib') diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp index b6e207f7a74..12ae237c452 100644 --- a/llvm/lib/TableGen/TGParser.cpp +++ b/llvm/lib/TableGen/TGParser.cpp @@ -944,9 +944,7 @@ Init *TGParser::ParseOperation(Record *CurRec, RecTy *ItemType) { // If we are doing !listconcat, we should know the type by now if (OpTok == tgtok::XListConcat) { - if (VarInit *Arg0 = dyn_cast(InitList[0])) - Type = Arg0->getType(); - else if (ListInit *Arg0 = dyn_cast(InitList[0])) + if (TypedInit *Arg0 = dyn_cast(InitList[0])) Type = Arg0->getType(); else { InitList[0]->print(errs()); -- cgit v1.2.3