LLVM  8.0.1
Public Member Functions | Public Attributes | List of all members
llvm::InlineAsm::ConstraintInfo Struct Reference

#include "llvm/IR/InlineAsm.h"

Inheritance diagram for llvm::InlineAsm::ConstraintInfo:
Inheritance graph
[legend]
Collaboration diagram for llvm::InlineAsm::ConstraintInfo:
Collaboration graph
[legend]

Public Member Functions

bool hasMatchingInput () const
 hasMatchingInput - Return true if this is an output constraint that has a matching input constraint. More...
 
 ConstraintInfo ()=default
 Default constructor. More...
 
bool Parse (StringRef Str, ConstraintInfoVector &ConstraintsSoFar)
 Parse - Analyze the specified string (e.g. More...
 
void selectAlternative (unsigned index)
 selectAlternative - Point this constraint to the alternative constraint indicated by the index. More...
 

Public Attributes

ConstraintPrefix Type = isInput
 Type - The basic type of the constraint: input/output/clobber. More...
 
bool isEarlyClobber = false
 isEarlyClobber - "&": output operand writes result before inputs are all read. More...
 
int MatchingInput = -1
 MatchingInput - If this is not -1, this is an output constraint where an input constraint is required to match it (e.g. More...
 
bool isCommutative = false
 isCommutative - This is set to true for a constraint that is commutative with the next operand. More...
 
bool isIndirect = false
 isIndirect - True if this operand is an indirect operand. More...
 
ConstraintCodeVector Codes
 Code - The constraint code, either the register name (in braces) or the constraint letter/number. More...
 
bool isMultipleAlternative = false
 isMultipleAlternative - '|': has multiple-alternative constraints. More...
 
SubConstraintInfoVector multipleAlternatives
 multipleAlternatives - If there are multiple alternative constraints, this array will contain them. More...
 
unsigned currentAlternativeIndex = 0
 The currently selected alternative constraint index. More...
 

Detailed Description

Definition at line 118 of file InlineAsm.h.

Constructor & Destructor Documentation

◆ ConstraintInfo()

llvm::InlineAsm::ConstraintInfo::ConstraintInfo ( )
default

Default constructor.

Member Function Documentation

◆ hasMatchingInput()

bool llvm::InlineAsm::ConstraintInfo::hasMatchingInput ( ) const
inline

hasMatchingInput - Return true if this is an output constraint that has a matching input constraint.

Definition at line 135 of file InlineAsm.h.

Referenced by ChooseConstraint(), and llvm::TargetLowering::ParseConstraints().

◆ Parse()

bool InlineAsm::ConstraintInfo::Parse ( StringRef  Str,
InlineAsm::ConstraintInfoVector ConstraintsSoFar 
)

Parse - Analyze the specified string (e.g.

"=*&{eax}") and fill in the fields in this structure. If the constraint string is not understood, return true, otherwise return false.

"==&{eax}") and fill in the fields in this structure. If the constraint string is not understood, return true, otherwise return false.

Definition at line 64 of file InlineAsm.cpp.

References assert(), llvm::StringRef::begin(), llvm::StringRef::count(), E, llvm::StringRef::end(), llvm::find(), I, isInput(), llvm::InlineAsm::SubConstraintInfo::MatchingInput, and N.

Referenced by llvm::InlineAsm::ParseConstraints().

◆ selectAlternative()

void InlineAsm::ConstraintInfo::selectAlternative ( unsigned  index)

selectAlternative - Point this constraint to the alternative constraint indicated by the index.

Definition at line 197 of file InlineAsm.cpp.

References llvm::InlineAsm::SubConstraintInfo::Codes, and llvm::InlineAsm::SubConstraintInfo::MatchingInput.

Referenced by llvm::TargetLowering::ParseConstraints().

Member Data Documentation

◆ Codes

ConstraintCodeVector llvm::InlineAsm::ConstraintInfo::Codes

Code - The constraint code, either the register name (in braces) or the constraint letter/number.

Definition at line 149 of file InlineAsm.h.

Referenced by asmClobbersCTR(), ChooseConstraint(), llvm::TargetLowering::ComputeConstraintToUse(), llvm::TargetLowering::getMultipleConstraintMatchWeight(), and llvm::hasInlineAsmMemConstraint().

◆ currentAlternativeIndex

unsigned llvm::InlineAsm::ConstraintInfo::currentAlternativeIndex = 0

The currently selected alternative constraint index.

Definition at line 159 of file InlineAsm.h.

◆ isCommutative

bool llvm::InlineAsm::ConstraintInfo::isCommutative = false

isCommutative - This is set to true for a constraint that is commutative with the next operand.

Definition at line 139 of file InlineAsm.h.

◆ isEarlyClobber

bool llvm::InlineAsm::ConstraintInfo::isEarlyClobber = false

isEarlyClobber - "&": output operand writes result before inputs are all read.

This is only ever set for an output operand.

Definition at line 125 of file InlineAsm.h.

◆ isIndirect

bool llvm::InlineAsm::ConstraintInfo::isIndirect = false

isIndirect - True if this operand is an indirect operand.

This means that the address of the source or destination is present in the call instruction, instead of it being returned or passed in explicitly. This is represented with a '*' in the asm string.

Definition at line 145 of file InlineAsm.h.

Referenced by llvm::hasInlineAsmMemConstraint(), IsNonLocalValue(), IsOperandAMemoryOperand(), and llvm::TargetLowering::ParseConstraints().

◆ isMultipleAlternative

bool llvm::InlineAsm::ConstraintInfo::isMultipleAlternative = false

isMultipleAlternative - '|': has multiple-alternative constraints.

Definition at line 152 of file InlineAsm.h.

◆ MatchingInput

int llvm::InlineAsm::ConstraintInfo::MatchingInput = -1

MatchingInput - If this is not -1, this is an output constraint where an input constraint is required to match it (e.g.

"0"). The value is the constraint number that matches this one (for example, if this is constraint #0 and constraint #4 has the value "0", this will be 4).

Definition at line 131 of file InlineAsm.h.

Referenced by llvm::TargetLowering::ParseConstraints().

◆ multipleAlternatives

SubConstraintInfoVector llvm::InlineAsm::ConstraintInfo::multipleAlternatives

multipleAlternatives - If there are multiple alternative constraints, this array will contain them.

Otherwise it will be empty.

Definition at line 156 of file InlineAsm.h.

Referenced by llvm::TargetLowering::getMultipleConstraintMatchWeight(), and llvm::TargetLowering::ParseConstraints().

◆ Type

ConstraintPrefix llvm::InlineAsm::ConstraintInfo::Type = isInput

Type - The basic type of the constraint: input/output/clobber.

Definition at line 121 of file InlineAsm.h.

Referenced by asmClobbersCTR(), findMatchingInlineAsmOperand(), IsNonLocalValue(), and llvm::TargetLowering::ParseConstraints().


The documentation for this struct was generated from the following files: