summaryrefslogtreecommitdiff
path: root/utils/TableGen/Record.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-09-13 21:44:28 +0000
committerChris Lattner <sabre@nondot.org>2005-09-13 21:44:28 +0000
commit8f493130bb51dea34c49e08aeab161e6a32dfdc6 (patch)
tree5e6dbf923b6c82419210d5e82821256f59b3c29b /utils/TableGen/Record.h
parentee9f0c3c2ea8d32218680488fe030bd19547e8b4 (diff)
downloadllvm-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.h6
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);