From 798dc7adb4f473c196c0000728fbaab0eb4fd8f2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 27 Feb 2007 20:43:37 +0000 Subject: 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 --- utils/TableGen/Record.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'utils/TableGen/Record.cpp') 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 &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(Values[i]); + if (DI == 0) throw "Expected record in list!"; + return DI->getDef(); +} + Init *ListInit::resolveReferences(Record &R, const RecordVal *RV) { std::vector Resolved; Resolved.reserve(getSize()); -- cgit v1.2.3