30InlineAsm::InlineAsm(
FunctionType *FTy, 
const std::string &asmString,
 
   31                     const std::string &constraints, 
bool hasSideEffects,
 
   32                     bool isAlignStack, AsmDialect asmDialect, 
bool canThrow)
 
   34      AsmString(asmString), Constraints(constraints), FTy(FTy),
 
   35      HasSideEffects(hasSideEffects), IsAlignStack(isAlignStack),
 
   36      Dialect(asmDialect), CanThrow(
canThrow) {
 
   54void InlineAsm::destroyConstant() {
 
   73  AsmStr.
split(AsmStrs, 
"\n\t", -1, 
false);
 
 
   82  unsigned multipleAlternativeCount = Str.count(
'|') + 1;
 
   83  unsigned multipleAlternativeIndex = 0;
 
  105    if (
I != E && *
I != 
'{')
 
  107  } 
else if (*
I == 
'=') {
 
  110  } 
else if (*
I == 
'!') {
 
  120  if (
I == E) 
return true;  
 
  123  bool DoneWithModifiers = 
false;
 
  124  while (!DoneWithModifiers) {
 
  127      DoneWithModifiers = 
true;
 
  146    if (!DoneWithModifiers) {
 
  148      if (
I == E) 
return true;   
 
  157      if (ConstraintEnd == E) 
return true;  
 
  158      pCodes->push_back(std::string(
StringRef(
I, ConstraintEnd + 1 - 
I)));
 
  160    } 
else if (isdigit(
static_cast<unsigned char>(*
I))) { 
 
  163      while (
I != E && isdigit(
static_cast<unsigned char>(*
I)))
 
  165      pCodes->push_back(std::string(
StringRef(NumStart, 
I - NumStart)));
 
  166      unsigned N = atoi(pCodes->back().c_str());
 
  168      if (
N >= ConstraintsSoFar.size() || ConstraintsSoFar[
N].Type != 
isOutput||
 
  175        if (multipleAlternativeIndex >=
 
  179          ConstraintsSoFar[
N].multipleAlternatives[multipleAlternativeIndex];
 
  188                ConstraintsSoFar.size())
 
  191        ConstraintsSoFar[
N].MatchingInput = ConstraintsSoFar.size();
 
  194    } 
else if (*
I == 
'|') {
 
  195      multipleAlternativeIndex++;
 
  198    } 
else if (*
I == 
'^') {
 
  201      pCodes->push_back(std::string(
StringRef(
I + 1, 2)));
 
  203    } 
else if (*
I == 
'@') {
 
  206      unsigned char C = 
static_cast<unsigned char>(*I);
 
  207      assert(isdigit(
C) && 
"Expected a digit!");
 
  209      assert(
N > 0 && 
"Found a zero letter constraint!");
 
  215      pCodes->push_back(std::string(
StringRef(
I, 1)));
 
 
  241         E = Constraints.end(); 
I != E; ) {
 
  247    if (ConstraintEnd == 
I ||  
 
  248        Info.Parse(
StringRef(
I, ConstraintEnd-
I), Result)) {
 
  253    Result.push_back(Info);
 
 
  281  if (Constraints.empty() && !ConstStr.
empty())
 
  284  unsigned NumOutputs = 0, NumInputs = 0, NumClobbers = 0;
 
  285  unsigned NumIndirect = 0, NumLabels = 0;
 
  288    switch (Constraint.Type) {
 
  290      if ((NumInputs-NumIndirect) != 0 || NumClobbers != 0 || NumLabels != 0)
 
  292                               "clobber or label constraint");
 
  294      if (!Constraint.isIndirect) {
 
  319  switch (NumOutputs) {
 
  321    if (!Ty->getReturnType()->isVoidTy())
 
  325    if (Ty->getReturnType()->isStructTy())
 
  326      return makeStringError(
"inline asm with one output cannot return struct");
 
  332                             "number of return struct elements");
 
  336  if (Ty->getNumParams() != NumInputs)
 
  337    return makeStringError(
"number of input constraints does not match number " 
 
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
 
static Error makeStringError(const char *Msg)
 
static bool canThrow(const Value *V)
 
Lightweight error class with error context and mandatory checking.
 
static ErrorSuccess success()
Create a success value.
 
Class to represent function types.
 
LLVM_ABI void collectAsmStrs(SmallVectorImpl< StringRef > &AsmStrs) const
 
static LLVM_ABI InlineAsm * get(FunctionType *Ty, StringRef AsmString, StringRef Constraints, bool hasSideEffects, bool isAlignStack=false, AsmDialect asmDialect=AD_ATT, bool canThrow=false)
InlineAsm::get - Return the specified uniqued inline asm string.
 
std::vector< ConstraintInfo > ConstraintInfoVector
 
friend struct InlineAsmKeyType
 
bool isAlignStack() const
 
LLVM_ABI FunctionType * getFunctionType() const
getFunctionType - InlineAsm's are always pointers to functions.
 
bool hasSideEffects() const
 
ConstraintInfoVector ParseConstraints() const
ParseConstraints - Parse the constraints of this inlineasm object, returning them the same way that P...
 
std::vector< std::string > ConstraintCodeVector
 
static LLVM_ABI Error verify(FunctionType *Ty, StringRef Constraints)
This static method can be used by the parser to check to see if the specified constraint string is le...
 
PointerType * getType() const
getType - InlineAsm's are always pointers.
 
ConstantUniqueMap< InlineAsm > InlineAsms
 
LLVMContextImpl *const pImpl
 
static PointerType * getUnqual(Type *ElementType)
This constructs a pointer to an object of the specified type in the default address space (address sp...
 
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
 
StringRef - Represent a constant reference to a string, i.e.
 
std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
 
constexpr bool empty() const
empty - Check if the string is empty.
 
Class to represent struct types.
 
unsigned getNumElements() const
Random access to the elements.
 
LLVMContext & getContext() const
Return the LLVMContext in which this type was uniqued.
 
LLVM Value Representation.
 
@ C
The default llvm calling convention, compatible with C.
 
Context & getContext() const
 
This is an optimization pass for GlobalISel generic memory operations.
 
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
 
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
 
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
 
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
 
bool isCommutative
isCommutative - This is set to true for a constraint that is commutative with the next operand.
 
ConstraintPrefix Type
Type - The basic type of the constraint: input/output/clobber/label.
 
int MatchingInput
MatchingInput - If this is not -1, this is an output constraint where an input constraint is required...
 
ConstraintCodeVector Codes
Code - The constraint code, either the register name (in braces) or the constraint letter/number.
 
unsigned currentAlternativeIndex
The currently selected alternative constraint index.
 
LLVM_ABI bool Parse(StringRef Str, ConstraintInfoVector &ConstraintsSoFar)
Parse - Analyze the specified string (e.g.
 
SubConstraintInfoVector multipleAlternatives
multipleAlternatives - If there are multiple alternative constraints, this array will contain them.
 
bool isIndirect
isIndirect - True if this operand is an indirect operand.
 
bool isEarlyClobber
isEarlyClobber - "&": output operand writes result before inputs are all read.
 
bool isMultipleAlternative
isMultipleAlternative - '|': has multiple-alternative constraints.
 
LLVM_ABI void selectAlternative(unsigned index)
selectAlternative - Point this constraint to the alternative constraint indicated by the index.
 
bool hasMatchingInput() const
hasMatchingInput - Return true if this is an output constraint that has a matching input constraint.
 
ConstraintCodeVector Codes
Code - The constraint code, either the register name (in braces) or the constraint letter/number.
 
int MatchingInput
MatchingInput - If this is not -1, this is an output constraint where an input constraint is required...