Implement VarListElementInit:: resolveListElementReference

Implement VarListElementInit:: resolveListElementReference so that
lists of lists can be indexed.

llvm-svn: 140882
diff --git a/llvm/utils/TableGen/Record.cpp b/llvm/utils/TableGen/Record.cpp
index 8c47888..3d42a52 100644
--- a/llvm/utils/TableGen/Record.cpp
+++ b/llvm/utils/TableGen/Record.cpp
@@ -1443,8 +1443,16 @@
 Init *VarListElementInit:: resolveListElementReference(Record &R,
                                                        const RecordVal *RV,
                                                        unsigned Elt) const {
-  // FIXME: This should be implemented, to support references like:
-  // int B = AA[0][1];
+  Init *Result = TI->resolveListElementReference(R, RV, Element);
+  
+  if (Result) {
+    TypedInit *TInit = dynamic_cast<TypedInit *>(Result);
+    if (TInit) {
+      return TInit->resolveListElementReference(R, RV, Elt);
+    }
+    return Result;
+  }
+ 
   return 0;
 }