From 1045a594e65c65c55dfcd9585658eee85ef79e75 Mon Sep 17 00:00:00 2001 From: David Greene Date: Fri, 30 Sep 2011 20:59:49 +0000 Subject: [PATCH] Implement VarListElementInit:: resolveListElementReference Implement VarListElementInit:: resolveListElementReference so that lists of lists can be indexed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140882 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/Record.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp index 8c47888dbed..3d42a5233cf 100644 --- a/utils/TableGen/Record.cpp +++ b/utils/TableGen/Record.cpp @@ -1443,8 +1443,16 @@ Init *VarListElementInit::resolveBitReference(Record &R, const RecordVal *RV, 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(Result); + if (TInit) { + return TInit->resolveListElementReference(R, RV, Elt); + } + return Result; + } + return 0; }