16 #ifndef LLVM_IR_INLINEASM_H
17 #define LLVM_IR_INLINEASM_H
28 struct InlineAsmKeyType;
29 template<
class ValType,
class ValRefType,
class TypeClass,
class ConstantClass,
32 template<
class ConstantClass,
class TypeClass,
class ValType>
48 void operator=(const
InlineAsm&) LLVM_DELETED_FUNCTION;
50 std::
string AsmString, Constraints;
62 void destroyConstant();
68 StringRef Constraints,
bool hasSideEffects,
69 bool isAlignStack =
false,
72 bool hasSideEffects()
const {
return HasSideEffects; }
211 MIOp_FirstOperand = 2,
214 Extra_HasSideEffects = 1,
215 Extra_IsAlignStack = 2,
216 Extra_AsmDialect = 4,
225 Kind_RegDefEarlyClobber = 3,
230 Flag_MatchingOperand = 0x80000000
234 assert(((NumOps << 3) & ~0xffff) == 0 &&
"Too many inline asm operands!");
235 assert(Kind >= Kind_RegUse && Kind <= Kind_Mem &&
"Invalid Kind");
236 return Kind | (NumOps << 3);
243 unsigned MatchedOperandNo) {
244 assert(MatchedOperandNo <= 0x7fff &&
"Too big matched operand");
245 assert((InputFlag & ~0xffff) == 0 &&
"High bits already contain data");
246 return InputFlag | Flag_MatchingOperand | (MatchedOperandNo << 16);
257 assert(RC <= 0x7fff &&
"Too large register class ID");
258 assert((InputFlag & ~0xffff) == 0 &&
"High bits already contain data");
259 return InputFlag | (RC << 16);
270 return getKind(Flag) == Kind_RegDefEarlyClobber;
273 return getKind(Flag) == Kind_Clobber;
279 return (Flag & 0xffff) >> 3;
285 if ((Flag & Flag_MatchingOperand) == 0)
287 Idx = (Flag & ~Flag_MatchingOperand) >> 16;
294 if (Flag & Flag_MatchingOperand)
296 unsigned High = Flag >> 16;
AsmDialect getDialect() const
static unsigned getFlagWord(unsigned Kind, unsigned NumOps)
const std::string & getAsmString() const
static bool isClobberKind(unsigned Flag)
const std::string & getConstraintString() const
bool Parse(StringRef Str, ConstraintInfoVector &ConstraintsSoFar)
static bool isImmKind(unsigned Flag)
static bool isUseOperandTiedToDef(unsigned Flag, unsigned &Idx)
ConstraintCodeVector Codes
static unsigned getFlagWordForRegClass(unsigned InputFlag, unsigned RC)
std::vector< SubConstraintInfo > SubConstraintInfoVector
ConstraintInfoVector ParseConstraints() const
static bool isRegDefEarlyClobberKind(unsigned Flag)
signed char MatchingInput
static bool Verify(FunctionType *Ty, StringRef Constraints)
static bool isRegDefKind(unsigned Flag)
static bool classof(const Value *V)
bool hasSideEffects() const
unsigned currentAlternativeIndex
The currently selected alternative constraint index.
ConstraintInfo()
Default constructor.
SubConstraintInfoVector multipleAlternatives
PointerType * getType() const
static unsigned getNumOperandRegisters(unsigned Flag)
unsigned getValueID() const
static unsigned getKind(unsigned Flags)
enum LLVM_ENUM_INT_TYPE(uint32_t)
static bool isMemKind(unsigned Flag)
SubConstraintInfo()
Default constructor.
signed char MatchingInput
FunctionType * getFunctionType() const
std::vector< std::string > ConstraintCodeVector
ConstraintCodeVector Codes
bool hasMatchingInput() const
#define LLVM_DELETED_FUNCTION
static bool hasRegClassConstraint(unsigned Flag, unsigned &RC)
static InlineAsm * get(FunctionType *Ty, StringRef AsmString, StringRef Constraints, bool hasSideEffects, bool isAlignStack=false, AsmDialect asmDialect=AD_ATT)
LLVM Value Representation.
bool isAlignStack() const
std::vector< ConstraintInfo > ConstraintInfoVector
bool isMultipleAlternative
isMultipleAlternative - '|': has multiple-alternative constraints.
static unsigned getFlagWordForMatchingOp(unsigned InputFlag, unsigned MatchedOperandNo)
void selectAlternative(unsigned index)