diff options
author | Chris Lattner <sabre@nondot.org> | 2006-01-26 02:21:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-01-26 02:21:42 +0000 |
commit | 507fdbc0e8cfece312779e45eb86f2320c75b87e (patch) | |
tree | b831b529f795ee7bce90a13f674e0ae2d698abeb | |
parent | 8eab3608de260527929d327a5e63b547c0d267cf (diff) | |
download | external_llvm-507fdbc0e8cfece312779e45eb86f2320c75b87e.zip external_llvm-507fdbc0e8cfece312779e45eb86f2320c75b87e.tar.gz external_llvm-507fdbc0e8cfece312779e45eb86f2320c75b87e.tar.bz2 |
add methods for constraint parsing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25636 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/InlineAsm.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/llvm/InlineAsm.h b/include/llvm/InlineAsm.h index b4edaac..50d0005 100644 --- a/include/llvm/InlineAsm.h +++ b/include/llvm/InlineAsm.h @@ -17,6 +17,7 @@ #define LLVM_INLINEASM_H #include "llvm/Value.h" +#include <vector> namespace llvm { @@ -65,6 +66,24 @@ public: /// static bool Verify(const FunctionType *Ty, const std::string &Constraints); + // Constraint String Parsing + enum ConstraintPrefix { + isInput, // 'x' + isOutput, // '=x' + isIndirectOutput, // '==x' + isClobber, // '~x' + }; + + /// ParseConstraints - Split up the constraint string into the specific + /// constraints and their prefixes. If this returns an empty vector, and if + /// the constraint string itself isn't empty, there was an error parsing. + static std::vector<std::pair<ConstraintPrefix, std::string> > + ParseConstraints(const std::string &ConstraintString); + + std::vector<std::pair<ConstraintPrefix, std::string> > + ParseConstraints() const { + return ParseConstraints(Constraints); + } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const InlineAsm *) { return true; } |