add methods for constraint parsing

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25636 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-01-26 02:21:42 +00:00
parent 8eab3608de
commit 507fdbc0e8

View File

@ -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; }