Fix List-of-List Processing
Fix VarListElementInit::resolveListElementReference to return a
partially resolved VarListElementInint in the case where full
resolution is not possible. This allows TableGen to make forward
progress resolving certain complex list expressions.
llvm-svn: 141315
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index 44945e3..b7c51ca 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -1456,7 +1456,9 @@
if (Result) {
TypedInit *TInit = dynamic_cast<TypedInit *>(Result);
if (TInit) {
- return TInit->resolveListElementReference(R, RV, Elt);
+ Init *Result2 = TInit->resolveListElementReference(R, RV, Elt);
+ if (Result2) return Result2;
+ return new VarListElementInit(TInit, Elt);
}
return Result;
}