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
This commit is contained in:
David Greene 2011-09-30 20:59:49 +00:00
parent 310c9ea874
commit 1045a594e6

View File

@ -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<TypedInit *>(Result);
if (TInit) {
return TInit->resolveListElementReference(R, RV, Elt);
}
return Result;
}
return 0;
}