diff options
author | Chris Lattner <sabre@nondot.org> | 2005-09-13 21:44:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-09-13 21:44:28 +0000 |
commit | 8f493130bb51dea34c49e08aeab161e6a32dfdc6 (patch) | |
tree | 5e6dbf923b6c82419210d5e82821256f59b3c29b /utils/TableGen/Record.h | |
parent | ee9f0c3c2ea8d32218680488fe030bd19547e8b4 (diff) | |
download | llvm-8f493130bb51dea34c49e08aeab161e6a32dfdc6.tar.gz llvm-8f493130bb51dea34c49e08aeab161e6a32dfdc6.tar.bz2 llvm-8f493130bb51dea34c49e08aeab161e6a32dfdc6.tar.xz |
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
Diffstat (limited to 'utils/TableGen/Record.h')
-rw-r--r-- | utils/TableGen/Record.h | 6 |
1 files changed, 6 insertions, 0 deletions
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); |