From: David Greene Date: Fri, 30 Sep 2011 20:59:49 +0000 (+0000) Subject: Implement VarListElementInit:: resolveListElementReference X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=1045a594e65c65c55dfcd9585658eee85ef79e75;p=oota-llvm.git 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 --- 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; }