[llvm-commits] [llvm] r140882 - /llvm/trunk/utils/TableGen/Record.cpp
David Greene
greened at obbligato.org
Fri Sep 30 13:59:49 PDT 2011
Author: greened
Date: Fri Sep 30 15:59:49 2011
New Revision: 140882
URL: http://llvm.org/viewvc/llvm-project?rev=140882&view=rev
Log:
Implement VarListElementInit:: resolveListElementReference
Implement VarListElementInit:: resolveListElementReference so that
lists of lists can be indexed.
Modified:
llvm/trunk/utils/TableGen/Record.cpp
Modified: llvm/trunk/utils/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/Record.cpp?rev=140882&r1=140881&r2=140882&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/Record.cpp (original)
+++ llvm/trunk/utils/TableGen/Record.cpp Fri Sep 30 15:59:49 2011
@@ -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;
}
More information about the llvm-commits
mailing list