LLVM 20.0.0git
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]

Public Member Functions

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

Public Attributes

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

Detailed Description

Definition at line 123 of file InlineAsm.h.

Constructor & Destructor Documentation

◆ ConstraintInfo()

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

Default constructor.

Member Function Documentation

◆ hasArg()

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

Whether this constraint corresponds to an argument.

Definition at line 179 of file InlineAsm.h.

References isIndirect, llvm::InlineAsm::isInput, and llvm::InlineAsm::isOutput.

◆ 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 140 of file InlineAsm.h.

References MatchingInput.

Referenced by llvm::TargetLowering::getConstraintPreferences(), Parse(), 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 78 of file InlineAsm.cpp.

References assert(), llvm::CallingConv::C, Codes, currentAlternativeIndex, hasMatchingInput(), I, llvm::InlineAsm::isClobber, isCommutative, isEarlyClobber, isIndirect, llvm::InlineAsm::isInput, llvm::InlineAsm::isLabel, isMultipleAlternative, llvm::InlineAsm::isOutput, llvm::InlineAsm::SubConstraintInfo::MatchingInput, MatchingInput, multipleAlternatives, and N.

◆ selectAlternative()

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

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

Definition at line 224 of file InlineAsm.cpp.

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

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 154 of file InlineAsm.h.

Referenced by llvm::TargetLowering::ComputeConstraintToUse(), computeConstraintToUse(), llvm::TargetLowering::getConstraintPreferences(), and Parse().

◆ currentAlternativeIndex

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

The currently selected alternative constraint index.

Definition at line 164 of file InlineAsm.h.

Referenced by Parse().

◆ 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 144 of file InlineAsm.h.

Referenced by Parse().

◆ 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 130 of file InlineAsm.h.

Referenced by llvm::InlineAsmLowering::lowerInlineAsm(), and Parse().

◆ 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 150 of file InlineAsm.h.

Referenced by llvm::TargetLowering::getConstraintPreferences(), hasArg(), llvm::InlineAsmLowering::lowerInlineAsm(), Parse(), and llvm::TargetLowering::ParseConstraints().

◆ isMultipleAlternative

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

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

Definition at line 157 of file InlineAsm.h.

Referenced by Parse().

◆ 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 136 of file InlineAsm.h.

Referenced by hasMatchingInput(), Parse(), and 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 161 of file InlineAsm.h.

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

◆ Type

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

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

Definition at line 126 of file InlineAsm.h.

Referenced by llvm::InlineAsmLowering::lowerInlineAsm(), and llvm::TargetLowering::ParseConstraints().


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