LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::InlineAsm Class Reference

#include <InlineAsm.h>

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

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 Types inherited from llvm::Value
enum  ValueTy {
  ArgumentVal, BasicBlockVal, FunctionVal, GlobalAliasVal,
  GlobalVariableVal, UndefValueVal, BlockAddressVal, ConstantExprVal,
  ConstantAggregateZeroVal, ConstantDataArrayVal, ConstantDataVectorVal, ConstantIntVal,
  ConstantFPVal, ConstantArrayVal, ConstantStructVal, ConstantVectorVal,
  ConstantPointerNullVal, MDNodeVal, MDStringVal, InlineAsmVal,
  PseudoSourceValueVal, FixedStackPseudoSourceValueVal, InstructionVal, ConstantFirstVal = FunctionVal,
  ConstantLastVal = ConstantPointerNullVal
}
 
typedef value_use_iterator< Useruse_iterator
 
typedef value_use_iterator
< const User
const_use_iterator
 

Public Member Functions

bool hasSideEffects () const
 
bool isAlignStack () const
 
AsmDialect getDialect () const
 
PointerTypegetType () const
 
FunctionTypegetFunctionType () const
 
const std::string & getAsmString () const
 
const std::string & getConstraintString () const
 
ConstraintInfoVector ParseConstraints () const
 
enum LLVM_ENUM_INT_TYPE (uint32_t)
 
- Public Member Functions inherited from llvm::Value
virtual ~Value ()
 
void dump () const
 dump - Support for debugging, callable in GDB: V->dump() More...
 
void print (raw_ostream &O, AssemblyAnnotationWriter *AAW=0) const
 
TypegetType () const
 
LLVMContextgetContext () const
 All values hold a context through their type. More...
 
bool hasName () const
 
ValueNamegetValueName () const
 
void setValueName (ValueName *VN)
 
StringRef getName () const
 
void setName (const Twine &Name)
 
void takeName (Value *V)
 
void replaceAllUsesWith (Value *V)
 
bool use_empty () const
 
use_iterator use_begin ()
 
const_use_iterator use_begin () const
 
use_iterator use_end ()
 
const_use_iterator use_end () const
 
Useruse_back ()
 
const Useruse_back () const
 
bool hasOneUse () const
 
bool hasNUses (unsigned N) const
 
bool hasNUsesOrMore (unsigned N) const
 
bool isUsedInBasicBlock (const BasicBlock *BB) const
 
unsigned getNumUses () const
 
void addUse (Use &U)
 
unsigned getValueID () const
 
unsigned getRawSubclassOptionalData () const
 
void clearSubclassOptionalData ()
 
bool hasSameSubclassOptionalData (const Value *V) const
 
void intersectOptionalDataWith (const Value *V)
 
bool hasValueHandle () const
 
ValuestripPointerCasts ()
 Strips off any unneeded pointer casts, all-zero GEPs and aliases from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCasts () const
 
ValuestripPointerCastsNoFollowAliases ()
 Strips off any unneeded pointer casts and all-zero GEPs from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCastsNoFollowAliases () const
 
ValuestripInBoundsConstantOffsets ()
 Strips off unneeded pointer casts and all-constant GEPs from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsConstantOffsets () const
 
ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset)
 Strips like stripInBoundsConstantOffsets but also accumulates the constant offset stripped. More...
 
const ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const
 
ValuestripInBoundsOffsets ()
 Strips off unneeded pointer casts and any in-bounds offsets from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsOffsets () const
 
bool isDereferenceablePointer () const
 
ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB)
 
const ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const
 
void mutateType (Type *Ty)
 

Static Public Member Functions

static InlineAsmget (FunctionType *Ty, StringRef AsmString, StringRef Constraints, bool hasSideEffects, bool isAlignStack=false, AsmDialect asmDialect=AD_ATT)
 
static bool Verify (FunctionType *Ty, StringRef Constraints)
 
static ConstraintInfoVector ParseConstraints (StringRef ConstraintString)
 
static bool classof (const Value *V)
 
static unsigned getFlagWord (unsigned Kind, unsigned NumOps)
 
static unsigned getFlagWordForMatchingOp (unsigned InputFlag, unsigned MatchedOperandNo)
 
static unsigned getFlagWordForRegClass (unsigned InputFlag, unsigned RC)
 
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 getNumOperandRegisters (unsigned Flag)
 
static bool isUseOperandTiedToDef (unsigned Flag, unsigned &Idx)
 
static bool hasRegClassConstraint (unsigned Flag, unsigned &RC)
 

Friends

struct ConstantCreator< InlineAsm, PointerType, InlineAsmKeyType >
 
class ConstantUniqueMap< InlineAsmKeyType, const InlineAsmKeyType &, PointerType, InlineAsm, false >
 

Additional Inherited Members

- Static Public Attributes inherited from llvm::Value
static const unsigned MaximumAlignment = 1u << 29
 
- Protected Member Functions inherited from llvm::Value
virtual void printCustom (raw_ostream &O) const
 
 Value (Type *Ty, unsigned scid)
 
unsigned short getSubclassDataFromValue () const
 
void setValueSubclassData (unsigned short D)
 
- Protected Attributes inherited from llvm::Value
unsigned char SubclassOptionalData: 7
 

Detailed Description

Definition at line 35 of file InlineAsm.h.

Member Typedef Documentation

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

Definition at line 102 of file InlineAsm.h.

Definition at line 118 of file InlineAsm.h.

Definition at line 117 of file InlineAsm.h.

Member Enumeration Documentation

Enumerator
AD_ATT 
AD_Intel 

Definition at line 37 of file InlineAsm.h.

Enumerator
isInput 
isOutput 
isClobber 

Definition at line 96 of file InlineAsm.h.

Member Function Documentation

static bool llvm::InlineAsm::classof ( const Value V)
inlinestatic

Definition at line 192 of file InlineAsm.h.

References llvm::Value::getValueID(), and llvm::Value::InlineAsmVal.

InlineAsm * InlineAsm::get ( FunctionType Ty,
StringRef  AsmString,
StringRef  Constraints,
bool  hasSideEffects,
bool  isAlignStack = false,
AsmDialect  asmDialect = AD_ATT 
)
static

InlineAsm::get - Return the specified uniqued inline asm string.

Definition at line 28 of file InlineAsm.cpp.

References llvm::Type::getContext(), llvm::PointerType::getUnqual(), llvm::LLVMContextImpl::InlineAsms, and llvm::LLVMContext::pImpl.

Referenced by inlineAsmOut(), LLVMConstInlineAsm(), and llvm::MapValue().

const std::string& llvm::InlineAsm::getAsmString ( ) const
inline
const std::string& llvm::InlineAsm::getConstraintString ( ) const
inline
AsmDialect llvm::InlineAsm::getDialect ( ) const
inline

Definition at line 74 of file InlineAsm.h.

Referenced by llvm::ConstantKeyData< InlineAsm >::getValType().

static unsigned llvm::InlineAsm::getFlagWord ( unsigned  Kind,
unsigned  NumOps 
)
inlinestatic

Definition at line 233 of file InlineAsm.h.

Referenced by llvm::SelectionDAGISel::SelectInlineAsmMemoryOperands().

static unsigned llvm::InlineAsm::getFlagWordForMatchingOp ( unsigned  InputFlag,
unsigned  MatchedOperandNo 
)
inlinestatic

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

static unsigned llvm::InlineAsm::getFlagWordForRegClass ( unsigned  InputFlag,
unsigned  RC 
)
inlinestatic

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

FunctionType * InlineAsm::getFunctionType ( ) const

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)
inlinestatic
static unsigned llvm::InlineAsm::getNumOperandRegisters ( unsigned  Flag)
inlinestatic
PointerType* llvm::InlineAsm::getType ( ) const
inline

getType - InlineAsm's are always pointers.

Definition at line 78 of file InlineAsm.h.

References llvm::Value::getType().

Referenced by getFunctionType().

static bool llvm::InlineAsm::hasRegClassConstraint ( unsigned  Flag,
unsigned RC 
)
inlinestatic

hasRegClassConstraint - Returns true if the flag contains a register class constraint. Sets RC to the register class ID.

Definition at line 293 of file InlineAsm.h.

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

bool llvm::InlineAsm::hasSideEffects ( ) const
inline

Definition at line 72 of file InlineAsm.h.

Referenced by llvm::ConstantKeyData< InlineAsm >::getValType().

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

Definition at line 73 of file InlineAsm.h.

Referenced by llvm::ConstantKeyData< InlineAsm >::getValType().

static bool llvm::InlineAsm::isClobberKind ( unsigned  Flag)
inlinestatic

Definition at line 272 of file InlineAsm.h.

References getKind().

static bool llvm::InlineAsm::isImmKind ( unsigned  Flag)
inlinestatic

Definition at line 267 of file InlineAsm.h.

References getKind().

static bool llvm::InlineAsm::isMemKind ( unsigned  Flag)
inlinestatic
static bool llvm::InlineAsm::isRegDefEarlyClobberKind ( unsigned  Flag)
inlinestatic

Definition at line 269 of file InlineAsm.h.

References getKind().

static bool llvm::InlineAsm::isRegDefKind ( unsigned  Flag)
inlinestatic

Definition at line 266 of file InlineAsm.h.

References getKind().

static bool llvm::InlineAsm::isUseOperandTiedToDef ( unsigned  Flag,
unsigned Idx 
)
inlinestatic

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

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

enum llvm::InlineAsm::LLVM_ENUM_INT_TYPE ( uint32_t  )
inline

Definition at line 200 of file InlineAsm.h.

InlineAsm::ConstraintInfoVector InlineAsm::ParseConstraints ( StringRef  ConstraintString)
static

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 213 of file InlineAsm.cpp.

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

Referenced by llvm::X86TargetLowering::ExpandInlineAsm(), and llvm::TargetLowering::ParseConstraints().

ConstraintInfoVector llvm::InlineAsm::ParseConstraints ( ) const
inline

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

Definition at line 187 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. This returns true if legal, false if not.

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

Definition at line 246 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

Definition at line 43 of file InlineAsm.h.

Definition at line 45 of file InlineAsm.h.


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