From 8f493130bb51dea34c49e08aeab161e6a32dfdc6 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 13 Sep 2005 21:44:28 +0000 Subject: Add a new Record::getValueAsCode method to mirror the other getValueAs* methods. Use it to simplify some code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23336 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/Record.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'utils/TableGen/Record.h') diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h index 4ca08902cf..edd875afce 100644 --- a/utils/TableGen/Record.h +++ b/utils/TableGen/Record.h @@ -1023,6 +1023,12 @@ public: /// the value is not the right type. /// DagInit *getValueAsDag(const std::string &FieldName) const; + + /// getValueAsCode - This method looks up the specified field and returns + /// its value as the string data in a CodeInit, throwing an exception if the + /// field does not exist or if the value is not a code object. + /// + std::string getValueAsCode(const std::string &FieldName) const; }; std::ostream &operator<<(std::ostream &OS, const Record &R); -- cgit v1.2.3