LLVM  mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends
llvm::InlineAsm Class Reference

#include <InlineAsm.h>

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

List of all members.

Classes

struct  ConstraintInfo
struct  SubConstraintInfo

Public Types

enum  AsmDialect { AD_ATT, AD_Intel }
enum  ConstraintPrefix { isInput, isOutput, isClobber }
typedef std::vector< std::string > ConstraintCodeVector
typedef std::vector
< SubConstraintInfo
SubConstraintInfoVector
typedef std::vector
< ConstraintInfo
ConstraintInfoVector

Public Member Functions

bool hasSideEffects () const
bool isAlignStack () const
AsmDialect getDialect () const
PointerTypegetType () const
 getType - InlineAsm's are always pointers.
FunctionTypegetFunctionType () const
 getFunctionType - InlineAsm's are always pointers to functions.
const std::string & getAsmString () const
const std::string & getConstraintString () const
ConstraintInfoVector ParseConstraints () const
 ParseConstraints - Parse the constraints of this inlineasm object, returning them the same way that ParseConstraints(str) does.

Static Public Member Functions

static InlineAsmget (FunctionType *Ty, StringRef AsmString, StringRef Constraints, bool hasSideEffects, bool isAlignStack=false, AsmDialect asmDialect=AD_ATT)
 InlineAsm::get - Return the specified uniqued inline asm string.
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 string is legal for the type.
static ConstraintInfoVector ParseConstraints (StringRef ConstraintString)
 ParseConstraints - Split up the constraint string into the specific constraints and their prefixes.
static bool classof (const Value *V)
static unsigned getFlagWord (unsigned Kind, unsigned NumOps)
static unsigned getFlagWordForMatchingOp (unsigned InputFlag, unsigned MatchedOperandNo)
 getFlagWordForMatchingOp - Augment an existing flag word returned by getFlagWord with information indicating that this input operand is tied to a previous output operand.
static unsigned getFlagWordForRegClass (unsigned InputFlag, unsigned RC)
 getFlagWordForRegClass - Augment an existing flag word returned by getFlagWord with the required register class for the following register operands.
static unsigned getFlagWordForMem (unsigned InputFlag, unsigned Constraint)
 Augment an existing flag word returned by getFlagWord with the constraint code for a memory constraint.
static unsigned convertMemFlagWordToMatchingFlagWord (unsigned InputFlag)
static unsigned getKind (unsigned Flags)
static bool isRegDefKind (unsigned Flag)
static bool isImmKind (unsigned Flag)
static bool isMemKind (unsigned Flag)
static bool isRegDefEarlyClobberKind (unsigned Flag)
static bool isClobberKind (unsigned Flag)
static unsigned getMemoryConstraintID (unsigned Flag)
static unsigned getNumOperandRegisters (unsigned Flag)
 getNumOperandRegisters - Extract the number of registers field from the inline asm operand flag.
static bool isUseOperandTiedToDef (unsigned Flag, unsigned &Idx)
 isUseOperandTiedToDef - Return true if the flag of the inline asm operand indicates it is an use operand that's matched to a def operand.
static bool hasRegClassConstraint (unsigned Flag, unsigned &RC)
 hasRegClassConstraint - Returns true if the flag contains a register class constraint.

Friends

struct InlineAsmKeyType
class ConstantUniqueMap< InlineAsm >

Detailed Description

Definition at line 32 of file InlineAsm.h.


Member Typedef Documentation

typedef std::vector<std::string> llvm::InlineAsm::ConstraintCodeVector

Definition at line 98 of file InlineAsm.h.

Definition at line 114 of file InlineAsm.h.

Definition at line 113 of file InlineAsm.h.


Member Enumeration Documentation

Enumerator:
AD_ATT 
AD_Intel 

Definition at line 34 of file InlineAsm.h.

Enumerator:
isInput 
isOutput 
isClobber 

Definition at line 92 of file InlineAsm.h.


Member Function Documentation

static bool llvm::InlineAsm::classof ( const Value V) [inline, static]

Definition at line 185 of file InlineAsm.h.

References llvm::Value::getValueID().

Definition at line 306 of file InlineAsm.h.

References Constraints_ShiftAmount, and isMemKind().

InlineAsm * InlineAsm::get ( FunctionType Ty,
StringRef  AsmString,
StringRef  Constraints,
bool  hasSideEffects,
bool  isAlignStack = false,
AsmDialect  asmDialect = AD_ATT 
) [static]
const std::string& llvm::InlineAsm::getAsmString ( ) const [inline]
const std::string& llvm::InlineAsm::getConstraintString ( ) const [inline]

Definition at line 70 of file InlineAsm.h.

Referenced by llvm::InlineAsmKeyType::operator==().

static unsigned llvm::InlineAsm::getFlagWord ( unsigned  Kind,
unsigned  NumOps 
) [inline, static]
static unsigned llvm::InlineAsm::getFlagWordForMatchingOp ( unsigned  InputFlag,
unsigned  MatchedOperandNo 
) [inline, static]

getFlagWordForMatchingOp - Augment an existing flag word returned by getFlagWord with information indicating that this input operand is tied to a previous output operand.

Definition at line 277 of file InlineAsm.h.

References Flag_MatchingOperand.

Referenced by llvm::RegsForValue::AddInlineAsmOperands().

static unsigned llvm::InlineAsm::getFlagWordForMem ( unsigned  InputFlag,
unsigned  Constraint 
) [inline, static]

Augment an existing flag word returned by getFlagWord with the constraint code for a memory constraint.

Definition at line 299 of file InlineAsm.h.

References Constraints_Max, and Constraints_ShiftAmount.

static unsigned llvm::InlineAsm::getFlagWordForRegClass ( unsigned  InputFlag,
unsigned  RC 
) [inline, static]

getFlagWordForRegClass - Augment an existing flag word returned by getFlagWord with the required register class for the following register operands.

A tied use operand cannot have a register class, use the register class from the def operand instead.

Definition at line 289 of file InlineAsm.h.

Referenced by llvm::RegsForValue::AddInlineAsmOperands().

getFunctionType - InlineAsm's are always pointers to functions.

Definition at line 55 of file InlineAsm.cpp.

References llvm::SequentialType::getElementType(), and getType().

static unsigned llvm::InlineAsm::getKind ( unsigned  Flags) [inline, static]
static unsigned llvm::InlineAsm::getMemoryConstraintID ( unsigned  Flag) [inline, static]
static unsigned llvm::InlineAsm::getNumOperandRegisters ( unsigned  Flag) [inline, static]

getType - InlineAsm's are always pointers.

Reimplemented from llvm::Value.

Definition at line 74 of file InlineAsm.h.

Referenced by getFunctionType().

static bool llvm::InlineAsm::hasRegClassConstraint ( unsigned  Flag,
unsigned RC 
) [inline, static]

hasRegClassConstraint - Returns true if the flag contains a register class constraint.

Sets RC to the register class ID.

Definition at line 347 of file InlineAsm.h.

References Flag_MatchingOperand.

Referenced by llvm::MachineInstr::getRegClassConstraint(), llvm::MachineInstr::print(), and llvm::ARMAsmPrinter::PrintAsmOperand().

Definition at line 68 of file InlineAsm.h.

Referenced by llvm::InlineAsmKeyType::operator==().

bool llvm::InlineAsm::isAlignStack ( ) const [inline]

Definition at line 69 of file InlineAsm.h.

Referenced by llvm::InlineAsmKeyType::operator==().

static bool llvm::InlineAsm::isClobberKind ( unsigned  Flag) [inline, static]

Definition at line 321 of file InlineAsm.h.

References getKind(), and Kind_Clobber.

static bool llvm::InlineAsm::isImmKind ( unsigned  Flag) [inline, static]

Definition at line 316 of file InlineAsm.h.

References getKind(), and Kind_Imm.

static bool llvm::InlineAsm::isMemKind ( unsigned  Flag) [inline, static]
static bool llvm::InlineAsm::isRegDefEarlyClobberKind ( unsigned  Flag) [inline, static]

Definition at line 318 of file InlineAsm.h.

References getKind(), and Kind_RegDefEarlyClobber.

static bool llvm::InlineAsm::isRegDefKind ( unsigned  Flag) [inline, static]

Definition at line 315 of file InlineAsm.h.

References getKind(), and Kind_RegDef.

static bool llvm::InlineAsm::isUseOperandTiedToDef ( unsigned  Flag,
unsigned Idx 
) [inline, static]

isUseOperandTiedToDef - Return true if the flag of the inline asm operand indicates it is an use operand that's matched to a def operand.

Definition at line 338 of file InlineAsm.h.

References Flag_MatchingOperand.

Referenced by llvm::MachineInstr::findTiedOperandIdx(), llvm::MachineInstr::print(), llvm::ARMAsmPrinter::PrintAsmOperand(), and llvm::SelectionDAGISel::SelectInlineAsmMemoryOperands().

ParseConstraints - Split up the constraint string into the specific constraints and their prefixes.

If this returns an empty vector, and if the constraint string itself isn't empty, there was an error parsing.

Definition at line 209 of file InlineAsm.cpp.

References llvm::StringRef::begin(), llvm::StringRef::end(), I, and llvm::InlineAsm::ConstraintInfo::Parse().

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

ParseConstraints - Parse the constraints of this inlineasm object, returning them the same way that ParseConstraints(str) does.

Definition at line 180 of file InlineAsm.h.

Referenced by Verify().

bool InlineAsm::Verify ( FunctionType Ty,
StringRef  ConstStr 
) [static]

Verify - This static method can be used by the parser to check to see if the specified constraint string is legal for the type.

Verify - Verify that the specified constraint string is reasonable for the specified function type, and otherwise validate the constraint string.

This returns true if legal, false if not.

Definition at line 245 of file InlineAsm.cpp.

References llvm::dyn_cast(), llvm::StringRef::empty(), llvm::StructType::getNumElements(), llvm::FunctionType::getNumParams(), llvm::FunctionType::getReturnType(), isClobber, isInput, isOutput, llvm::Type::isStructTy(), llvm::FunctionType::isVarArg(), llvm::Type::isVoidTy(), and ParseConstraints().


Friends And Related Function Documentation

friend class ConstantUniqueMap< InlineAsm > [friend]

Definition at line 41 of file InlineAsm.h.

friend struct InlineAsmKeyType [friend]

Definition at line 40 of file InlineAsm.h.


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