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
diff --git a/llvm/lib/TableGen/TGParser.cpp b/llvm/lib/TableGen/TGParser.cpp
index b6e207f..12ae237 100644
--- a/llvm/lib/TableGen/TGParser.cpp
+++ b/llvm/lib/TableGen/TGParser.cpp
@@ -944,9 +944,7 @@
 
     // If we are doing !listconcat, we should know the type by now
     if (OpTok == tgtok::XListConcat) {
-      if (VarInit *Arg0 = dyn_cast<VarInit>(InitList[0]))
-        Type = Arg0->getType();
-      else if (ListInit *Arg0 = dyn_cast<ListInit>(InitList[0]))
+      if (TypedInit *Arg0 = dyn_cast<TypedInit>(InitList[0]))
         Type = Arg0->getType();
       else {
         InitList[0]->print(errs());