summaryrefslogtreecommitdiff
path: root/utils/TableGen/Record.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-27 20:43:37 +0000
committerChris Lattner <sabre@nondot.org>2007-02-27 20:43:37 +0000
commit798dc7adb4f473c196c0000728fbaab0eb4fd8f2 (patch)
treec6dbcbe45ae8ffad95c3080010da90ab8fd6b65c /utils/TableGen/Record.cpp
parent914c3bca870e448731b210b528a6a2f450ece772 (diff)
downloadllvm-798dc7adb4f473c196c0000728fbaab0eb4fd8f2.tar.gz
llvm-798dc7adb4f473c196c0000728fbaab0eb4fd8f2.tar.bz2
llvm-798dc7adb4f473c196c0000728fbaab0eb4fd8f2.tar.xz
initial support for calling convention generation, still unfinished.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34682 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/Record.cpp')
-rw-r--r--utils/TableGen/Record.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/utils/TableGen/Record.cpp b/utils/TableGen/Record.cpp
index 94e0cb472f..bbcdbe7da3 100644
--- a/utils/TableGen/Record.cpp
+++ b/utils/TableGen/Record.cpp
@@ -337,6 +337,13 @@ Init *ListInit::convertInitListSlice(const std::vector<unsigned> &Elements) {
return new ListInit(Vals);
}
+Record *ListInit::getElementAsRecord(unsigned i) const {
+ assert(i < Values.size() && "List element index out of range!");
+ DefInit *DI = dynamic_cast<DefInit*>(Values[i]);
+ if (DI == 0) throw "Expected record in list!";
+ return DI->getDef();
+}
+
Init *ListInit::resolveReferences(Record &R, const RecordVal *RV) {
std::vector<Init*> Resolved;
Resolved.reserve(getSize());