LLVM API Documentation

llvm::Attribute Namespace Reference


Functions

Attributes typeIncompatible (const Type *Ty)
 Which attributes cannot be applied to a type.
Attributes constructAlignmentFromInt (unsigned i)
unsigned getAlignmentFromAttrs (Attributes A)
 This returns the alignment field of an attribute as a byte alignment value.
std::string getAsString (Attributes Attrs)
 Convert attribute bits to text.

Variables

const Attributes None = 0
 Function attributes.
const Attributes ZExt = 1<<0
 Zero extended before/after call.
const Attributes SExt = 1<<1
 Sign extended before/after call.
const Attributes NoReturn = 1<<2
 Mark the function as not returning.
const Attributes InReg = 1<<3
 Force argument to be passed in register.
const Attributes StructRet = 1<<4
 Hidden pointer to structure to return.
const Attributes NoUnwind = 1<<5
 Function doesn't unwind stack.
const Attributes NoAlias = 1<<6
 Considered to not alias after call.
const Attributes ByVal = 1<<7
 Pass structure by value.
const Attributes Nest = 1<<8
 Nested function static chain.
const Attributes ReadNone = 1<<9
 Function does not access memory.
const Attributes ReadOnly = 1<<10
 Function only reads from memory.
const Attributes NoInline = 1<<11
 inline=never
const Attributes AlwaysInline = 1<<12
 inline=always
const Attributes OptimizeForSize = 1<<13
 opt_size
const Attributes StackProtect = 1<<14
 Stack protection.
const Attributes StackProtectReq = 1<<15
 Stack protection required.
const Attributes Alignment = 31<<16
 Alignment of parameter (5 bits).
const Attributes NoCapture = 1<<21
 Function creates no aliases of pointer.
const Attributes NoRedZone = 1<<22
const Attributes NoImplicitFloat = 1<<23
 disable redzone
const Attributes Naked = 1<<24
 Naked function.
const Attributes ParameterOnly = ByVal | Nest | StructRet | NoCapture
 Attributes that only apply to function parameters.
const Attributes FunctionOnly
 Attributes that may be applied to the function itself. These cannot be used on return values or function parameters.
const Attributes VarArgsIncompatible = StructRet
 Parameter attributes that do not apply to vararg call arguments.
const Attributes MutuallyIncompatible [4]
 Attributes that are mutually incompatible.


Function Documentation

Attributes llvm::Attribute::constructAlignmentFromInt ( unsigned  i  )  [inline]

This turns an int alignment (a power of 2, normally) into the form used internally in Attributes.

Definition at line 87 of file Attributes.h.

References llvm::isPowerOf2_32(), and llvm::Log2_32().

Referenced by LLVMSetInstrParamAlignment(), and LLVMSetParamAlignment().

unsigned llvm::Attribute::getAlignmentFromAttrs ( Attributes  A  )  [inline]

This returns the alignment field of an attribute as a byte alignment value.

Definition at line 98 of file Attributes.h.

References Align, and Alignment.

Referenced by getAsString(), and llvm::AttrListPtr::getParamAlignment().

std::string llvm::Attribute::getAsString ( Attributes  Attrs  ) 

Convert attribute bits to text.

The set of Attributes set in Attributes is converted to a string of equivalent mnemonics. This is, presumably, for writing out the mnemonics for the assembly writer.

Definition at line 28 of file Attributes.cpp.

References Alignment, AlwaysInline, ByVal, getAlignmentFromAttrs(), InReg, Naked, Nest, NoAlias, NoCapture, NoImplicitFloat, NoInline, NoRedZone, NoReturn, NoUnwind, OptimizeForSize, ReadNone, ReadOnly, SExt, StackProtect, StackProtectReq, StructRet, llvm::utostr(), and ZExt.

Attributes llvm::Attribute::typeIncompatible ( const Type *  Ty  ) 

Which attributes cannot be applied to a type.

Definition at line 81 of file Attributes.cpp.

References ByVal, llvm::Type::isInteger(), Nest, NoAlias, NoCapture, None, SExt, StructRet, and ZExt.


Variable Documentation

Alignment of parameter (5 bits).

Definition at line 53 of file Attributes.h.

Referenced by llvm::AttrListPtr::addAttr(), getAlignmentFromAttrs(), getAsString(), and llvm::AttrListPtr::removeAttr().

inline=always

Definition at line 49 of file Attributes.h.

Referenced by getAsString(), and llvm::InlineCostAnalyzer::getInlineCost().

Initial value:

Attributes that may be applied to the function itself. These cannot be used on return values or function parameters.

Definition at line 67 of file Attributes.h.

Initial value:

Attributes that are mutually incompatible.

Definition at line 75 of file Attributes.h.

Naked function.

disable implicit floating point instructions.

Definition at line 60 of file Attributes.h.

Referenced by getAsString(), and llvm::PEI::runOnMachineFunction().

Nested function static chain.

Definition at line 45 of file Attributes.h.

Referenced by getAsString(), llvm::ISD::ArgFlagsTy::isNest(), llvm::SelectionDAGLowering::LowerCallTo(), StripNest(), and typeIncompatible().

disable redzone

Definition at line 58 of file Attributes.h.

Referenced by getAsString(), llvm::X86TargetLowering::getOptimalMemOpType(), and PerformSTORECombine().

inline=never

Definition at line 48 of file Attributes.h.

Referenced by getAsString(), and llvm::InlineCostAnalyzer::getInlineCost().

Function attributes.

Function parameters and results can have attributes to indicate how they should be treated by optimizations and code generation. This enumeration lists the attributes that can be associated with parameters, function results or the function itself. No attributes have been set

Definition at line 36 of file Attributes.h.

Referenced by llvm::AttrListPtr::get(), and typeIncompatible().

Attributes that only apply to function parameters.

Definition at line 63 of file Attributes.h.

Sign extended before/after call.

Definition at line 38 of file Attributes.h.

Referenced by llvm::CastInst::castIsValid(), llvm::SExtInst::classof(), llvm::ComputeMaskedBits(), llvm::ComputeNumSignBits(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldInstOperands(), llvm::ConvertConstant< ConstantExpr, Type >::convert(), llvm::CastInst::Create(), llvm::CastInst::CreateIntegerCast(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateSExt(), llvm::CastInst::CreateSExtOrBitCast(), llvm::AsmPrinter::EmitConstantValueOnly(), evaluateICmpRelation(), llvm::ScalarEvolution::getAnyExtendExpr(), getAsString(), llvm::ConstantExpr::getCast(), llvm::CastInst::getCastOpcode(), llvm::ExecutionEngine::getConstantValue(), GetDecodedCastOpcode(), GetEncodedCastOpcode(), llvm::ConstantExpr::getIntegerCast(), llvm::Instruction::getOpcodeName(), llvm::ConstantExpr::getSExt(), llvm::ConstantExpr::getSExtOrBitCast(), llvm::ScalarEvolution::getSignedRange(), llvm::ScalarEvolution::getUnsignedRange(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), InsertCastToIntPtrTy(), llvm::CastInst::isIntegerCast(), llvm::CastInst::isNoopCast(), llvm::ISD::ArgFlagsTy::isSExt(), llvm::SelectionDAGLowering::LowerCallTo(), llvm::MSILWriter::printCastInstruction(), llvm::MSILWriter::printConstantExpr(), llvm::MSILWriter::printFunction(), llvm::MSILWriter::printInstruction(), llvm::FastISel::SelectOperator(), typeIncompatible(), llvm::UpgradeIntrinsicCall(), and llvm::Interpreter::visitCallSite().

Stack protection.

Definition at line 51 of file Attributes.h.

Referenced by getAsString(), and llvm::Inliner::InlineCallIfPossible().

Stack protection required.

Definition at line 52 of file Attributes.h.

Referenced by getAsString(), and llvm::Inliner::InlineCallIfPossible().

Parameter attributes that do not apply to vararg call arguments.

Definition at line 72 of file Attributes.h.

Zero extended before/after call.

Definition at line 37 of file Attributes.h.

Referenced by getAsString(), llvm::SelectionDAGLowering::LowerCallTo(), typeIncompatible(), and llvm::Interpreter::visitCallSite().