16 #ifndef LLVM_IR_INLINEASM_H
17 #define LLVM_IR_INLINEASM_H
29 struct InlineAsmKeyType;
44 void operator=(
const InlineAsm&) =
delete;
46 std::string AsmString, Constraints;
58 void destroyConstant();
186 return V->
getValueID() == Value::InlineAsmVal;
269 assert(((NumOps << 3) & ~0xffff) == 0 &&
"Too many inline asm operands!");
271 return Kind | (NumOps << 3);
278 unsigned MatchedOperandNo) {
279 assert(MatchedOperandNo <= 0x7fff &&
"Too big matched operand");
280 assert((InputFlag & ~0xffff) == 0 &&
"High bits already contain data");
292 assert(RC <= 0x7fff &&
"Too large register class ID");
293 assert((InputFlag & ~0xffff) == 0 &&
"High bits already contain data");
294 return InputFlag | (RC << 16);
300 assert(Constraint <= 0x7fff &&
"Too large a memory constraint ID");
302 assert((InputFlag & ~0xffff) == 0 &&
"High bits already contain data");
333 return (Flag & 0xffff) >> 3;
341 Idx = (Flag & ~Flag_MatchingOperand) >> 16;
350 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)
Parse - Analyze the specified string (e.g.
static bool isImmKind(unsigned Flag)
static bool isUseOperandTiedToDef(unsigned Flag, unsigned &Idx)
isUseOperandTiedToDef - Return true if the flag of the inline asm operand indicates it is an use oper...
ConstraintCodeVector Codes
Code - The constraint code, either the register name (in braces) or the constraint letter/number...
static unsigned getFlagWordForRegClass(unsigned InputFlag, unsigned RC)
getFlagWordForRegClass - Augment an existing flag word returned by getFlagWord with the required regi...
bool isCommutative
isCommutative - This is set to true for a constraint that is commutative with the next operand...
std::vector< SubConstraintInfo > SubConstraintInfoVector
ConstraintInfoVector ParseConstraints() const
ParseConstraints - Parse the constraints of this inlineasm object, returning them the same way that P...
static bool isRegDefEarlyClobberKind(unsigned Flag)
static unsigned convertMemFlagWordToMatchingFlagWord(unsigned InputFlag)
FunctionType - Class to represent function types.
signed char MatchingInput
MatchingInput - If this is not -1, this is an output constraint where an input constraint is required...
static bool Verify(FunctionType *Ty, StringRef Constraints)
Verify - This static method can be used by the parser to check to see if the specified constraint str...
ConstraintPrefix Type
Type - The basic type of the constraint: input/output/clobber.
static bool isRegDefKind(unsigned Flag)
PointerType - Class to represent pointers.
Flag
These should be considered private to the implementation of the MCInstrDesc class.
bool isEarlyClobber
isEarlyClobber - "&": output operand writes result before inputs are all read.
static bool classof(const Value *V)
bool hasSideEffects() const
unsigned currentAlternativeIndex
The currently selected alternative constraint index.
bool isIndirect
isIndirect - True if this operand is an indirect operand.
ConstraintInfo()
Default constructor.
SubConstraintInfoVector multipleAlternatives
multipleAlternatives - If there are multiple alternative constraints, this array will contain them...
PointerType * getType() const
getType - InlineAsm's are always pointers.
static unsigned getNumOperandRegisters(unsigned Flag)
getNumOperandRegisters - Extract the number of registers field from the inline asm operand flag...
static unsigned getMemoryConstraintID(unsigned Flag)
unsigned getValueID() const
Return an ID for the concrete type of this object.
static unsigned getKind(unsigned Flags)
static unsigned getFlagWordForMem(unsigned InputFlag, unsigned Constraint)
Augment an existing flag word returned by getFlagWord with the constraint code for a memory constrain...
static bool isMemKind(unsigned Flag)
SubConstraintInfo()
Default constructor.
signed char MatchingInput
MatchingInput - If this is not -1, this is an output constraint where an input constraint is required...
FunctionType * getFunctionType() const
getFunctionType - InlineAsm's are always pointers to functions.
std::vector< std::string > ConstraintCodeVector
ConstraintCodeVector Codes
Code - The constraint code, either the register name (in braces) or the constraint letter/number...
Type * getType() const
All values are typed, get the type of this value.
bool hasMatchingInput() const
hasMatchingInput - Return true if this is an output constraint that has a matching input constraint...
static bool hasRegClassConstraint(unsigned Flag, unsigned &RC)
hasRegClassConstraint - Returns true if the flag contains a register class constraint.
const ARM::ArchExtKind Kind
LLVM Value Representation.
StringRef - Represent a constant reference to a string, i.e.
bool isAlignStack() const
std::vector< ConstraintInfo > ConstraintInfoVector
bool isMultipleAlternative
isMultipleAlternative - '|': has multiple-alternative constraints.
static unsigned getFlagWordForMatchingOp(unsigned InputFlag, unsigned MatchedOperandNo)
getFlagWordForMatchingOp - Augment an existing flag word returned by getFlagWord with information ind...
void selectAlternative(unsigned index)
selectAlternative - Point this constraint to the alternative constraint indicated by the index...