From: Chris Lattner Date: Thu, 26 Jan 2006 02:21:42 +0000 (+0000) Subject: add methods for constraint parsing X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=507fdbc0e8cfece312779e45eb86f2320c75b87e;p=oota-llvm.git add methods for constraint parsing git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25636 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/InlineAsm.h b/include/llvm/InlineAsm.h index b4edaacd196..50d00058fad 100644 --- a/include/llvm/InlineAsm.h +++ b/include/llvm/InlineAsm.h @@ -17,6 +17,7 @@ #define LLVM_INLINEASM_H #include "llvm/Value.h" +#include 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 > + ParseConstraints(const std::string &ConstraintString); + + std::vector > + ParseConstraints() const { + return ParseConstraints(Constraints); + } // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const InlineAsm *) { return true; }