LLVM API Documentation

llvm::Type Class Reference

Root of type hierarchy. More...

#include <Type.h>

Inheritance diagram for llvm::Type:
[legend]
Collaboration diagram for llvm::Type:
[legend]

List of all members.

Public Types

enum  TypeID {
  VoidTyID = 0, FloatTyID, DoubleTyID, X86_FP80TyID,
  FP128TyID, PPC_FP128TyID, LabelTyID, MetadataTyID,
  IntegerTyID, FunctionTyID, StructTyID, ArrayTyID,
  PointerTyID, OpaqueTyID, VectorTyID, NumTypeIDs,
  LastPrimitiveTyID = LabelTyID, FirstDerivedTyID = IntegerTyID
}
typedef PATypeHandle * subtype_iterator

Public Member Functions

void print (raw_ostream &O) const
void print (std::ostream &O) const
void dump () const
 Debugging support: print to stderr.
void dump (const Module *Context) const
 Debugging support: print to stderr (use type names from context module).
LLVMContext & getContext () const
 getContext - Fetch the LLVMContext in which this type was uniqued.
TypeID getTypeID () const
std::string getDescription () const
 getDescription - Return the string representation of the type.
bool isInteger () const
bool isIntOrIntVector () const
bool isFloatingPoint () const
bool isFPOrFPVector () const
bool isAbstract () const
bool canLosslesslyBitCastTo (const Type *Ty) const
 Determine if this type could be losslessly bitcast to Ty.
bool isPrimitiveType () const
bool isDerivedType () const
bool isFirstClassType () const
bool isSingleValueType () const
bool isAggregateType () const
bool isSized () const
unsigned getPrimitiveSizeInBits () const
unsigned getScalarSizeInBits () const
int getFPMantissaWidth () const
const Type * getForwardedType () const
const Type * getVAArgsPromotedType (LLVMContext &C) const
const Type * getScalarType () const
subtype_iterator subtype_begin () const
subtype_iterator subtype_end () const
const Type * getContainedType (unsigned i) const
unsigned getNumContainedTypes () const
void addRef () const
void dropRef () const
void addAbstractTypeUser (AbstractTypeUser *U) const
void removeAbstractTypeUser (AbstractTypeUser *U) const
PointerType * getPointerTo (unsigned AddrSpace=0) const

Static Public Member Functions

static const Type * getPrimitiveType (LLVMContext &C, TypeID IDNumber)
 getPrimitiveType - Return a type based on an identifier.
static const Type * getVoidTy (LLVMContext &C)
static const Type * getLabelTy (LLVMContext &C)
static const Type * getFloatTy (LLVMContext &C)
static const Type * getDoubleTy (LLVMContext &C)
static const Type * getMetadataTy (LLVMContext &C)
static const Type * getX86_FP80Ty (LLVMContext &C)
static const Type * getFP128Ty (LLVMContext &C)
static const Type * getPPC_FP128Ty (LLVMContext &C)
static const IntegerType * getInt1Ty (LLVMContext &C)
static const IntegerType * getInt8Ty (LLVMContext &C)
static const IntegerType * getInt16Ty (LLVMContext &C)
static const IntegerType * getInt32Ty (LLVMContext &C)
static const IntegerType * getInt64Ty (LLVMContext &C)
static bool classof (const Type *)
 Methods for support type inquiry through isa, cast, and dyn_cast:.

Protected Member Functions

 Type (LLVMContext &C, TypeID id)
virtual ~Type ()
void setAbstract (bool Val)
unsigned getRefCount () const
unsigned getSubclassData () const
void setSubclassData (unsigned val)
void PromoteAbstractToConcrete ()

Protected Attributes

const Type * ForwardType
std::vector< AbstractTypeUser * > AbstractTypeUsers
unsigned NumContainedTys
PATypeHandle * ContainedTys

Friends

class LLVMContextImpl
class TypeMapBase


Detailed Description

Root of type hierarchy.

This file contains the declaration of the Type class. For more "Type" type stuff, look in DerivedTypes.h.

The instances of the Type class are immutable: once they are created, they are never changed. Also note that only one instance of a particular type is ever created. Thus seeing if two types are equal is a matter of doing a trivial pointer comparison. To enforce that no two equal instances are created, Type instances can only be created via static factory methods in class Type and in derived classes.

Once allocated, Types are never free'd, unless they are an abstract type that is resolved to a more concrete type.

Types themself don't have a name, and can be named either by:

Opaque types are simple derived types with no state. There may be many different Opaque type objects floating around, but two are only considered identical if they are pointer equals of each other. This allows us to have two opaque types that end up resolving to different concrete types later.

Opaque types are also kinda weird and scary and different because they have to keep a list of uses of the type. When, through linking, parsing, or bitcode reading, they become resolved, they need to find and update all users of the unknown type, causing them to reference a new, more concrete type. Opaque types are deleted when their use list dwindles to zero users.

Definition at line 63 of file Type.h.


Member Typedef Documentation

Definition at line 320 of file Type.h.


Member Enumeration Documentation

Definitions of all of the base types for the Type system. Based on this value, you can cast to a "DerivedType" subclass (see DerivedTypes.h) Note: If you add an element to this, you need to add an element to the Type::getPrimitiveType function, or else things will break! Also update LLVMTypeKind and LLVMGetTypeKind () in the C binding.

Enumerator:
VoidTyID  0: type with no size
FloatTyID  1: 32 bit floating point type
DoubleTyID  2: 64 bit floating point type
X86_FP80TyID  3: 80 bit floating point type (X87)
FP128TyID  4: 128 bit floating point type (112-bit mantissa)
PPC_FP128TyID  5: 128 bit floating point type (two 64-bits)
LabelTyID  6: Labels
MetadataTyID  7: Metadata
IntegerTyID  8: Arbitrary bit width integers
FunctionTyID  9: Functions
StructTyID  10: Structures
ArrayTyID  11: Arrays
PointerTyID  12: Pointers
OpaqueTyID  13: Opaque: type with unknown structure
VectorTyID  14: SIMD 'packed' format, or other vector type
NumTypeIDs 
LastPrimitiveTyID 
FirstDerivedTyID 

Definition at line 72 of file Type.h.


Constructor & Destructor Documentation

llvm::Type::Type ( LLVMContext &  C,
TypeID  id 
) [inline, explicit, protected]

Definition at line 121 of file Type.h.

virtual llvm::Type::~Type (  )  [inline, protected, virtual]

Definition at line 126 of file Type.h.

References AbstractTypeUsers.


Member Function Documentation

void llvm::Type::setAbstract ( bool  Val  )  [inline, protected]

Types can become nonabstract later, if they are refined.

Definition at line 132 of file Type.h.

unsigned llvm::Type::getRefCount (  )  const [inline, protected]

Definition at line 134 of file Type.h.

References RefCount.

Referenced by removeAbstractTypeUser().

unsigned llvm::Type::getSubclassData (  )  const [inline, protected]

void llvm::Type::setSubclassData ( unsigned  val  )  [inline, protected]

Definition at line 137 of file Type.h.

Referenced by llvm::IntegerType::IntegerType().

void Type::print ( raw_ostream &  O  )  const

Definition at line 2018 of file AsmWriter.cpp.

Referenced by llvm::operator<<(), and print().

void Type::print ( std::ostream &  O  )  const

Definition at line 2013 of file AsmWriter.cpp.

References OS, and print().

void Type::dump (  )  const [virtual]

Debugging support: print to stderr.

Implements llvm::AbstractTypeUser.

Reimplemented in llvm::DerivedType.

Definition at line 2104 of file AsmWriter.cpp.

void Type::dump ( const Module *  Context  )  const

Debugging support: print to stderr (use type names from context module).

Definition at line 2098 of file AsmWriter.cpp.

References llvm::errs(), and llvm::WriteTypeSymbolic().

LLVMContext& llvm::Type::getContext (  )  const [inline]

getContext - Fetch the LLVMContext in which this type was uniqued.

Definition at line 181 of file Type.h.

References Context.

Referenced by addAbstractTypeUser(), llvm::AllocationInst::AllocationInst(), ComputeValueVTs(), llvm::ConstantCreator< MDNode, Type, std::vector< Value * > >::create(), llvm::ConstantExpr::destroyConstant(), llvm::UndefValue::destroyConstant(), llvm::ConstantPointerNull::destroyConstant(), llvm::ConstantVector::destroyConstant(), llvm::ConstantStruct::destroyConstant(), llvm::ConstantArray::destroyConstant(), llvm::ConstantAggregateZero::destroyConstant(), llvm::DerivedType::dropAllTypeUses(), dyn_castFoldableMul(), executeFCMP_ORD(), executeFCMP_UNO(), foldConstantCastPair(), llvm::PointerType::get(), llvm::VectorType::get(), llvm::ArrayType::get(), llvm::FunctionType::get(), llvm::UndefValue::get(), llvm::ConstantPointerNull::get(), llvm::ConstantAggregateZero::get(), llvm::ConstantVector::get(), llvm::ConstantStruct::get(), llvm::ConstantArray::get(), llvm::ConstantFP::get(), llvm::ConstantInt::get(), llvm::ConstantExpr::getAlignOf(), llvm::Constant::getAllOnesValue(), llvm::ExecutionEngine::getConstantValue(), llvm::Function::getContext(), llvm::BasicBlock::getContext(), getDescription(), llvm::EVT::getEVT(), llvm::VectorType::getExtendedElementVectorType(), llvm::ConstantExpr::getExtractElementTy(), llvm::ConstantExpr::getExtractValueTy(), getFoldedCast(), llvm::ConstantExpr::getGetElementPtrTy(), llvm::TargetData::getIndexedOffset(), llvm::ConstantExpr::getInsertElementTy(), llvm::ConstantExpr::getInsertValueTy(), llvm::VectorType::getInteger(), llvm::Constant::getIntegerValue(), llvm::ConstantFP::getNegativeZero(), llvm::Constant::getNullValue(), llvm::ConstantExpr::getOffsetOf(), getPromotedType(), llvm::ConstantExpr::getSelectTy(), llvm::ConstantExpr::getShuffleVectorTy(), llvm::ConstantExpr::getSizeOf(), llvm::VectorType::getTruncatedElementVectorType(), llvm::ConstantExpr::getTy(), llvm::FunctionType::isValidArgumentType(), llvm::PointerType::isValidElementType(), llvm::StructType::isValidElementType(), llvm::ArrayType::isValidElementType(), llvm::FunctionType::isValidReturnType(), llvm::ConstantInt::isValueValidForType(), llvm::X86TargetLowering::isZExtFree(), lle_X_scanf(), lle_X_sscanf(), llvm::TargetLowering::LowerCallTo(), llvm::DerivedType::notifyUsesThatTypeBecameConcrete(), llvm::PointerType::refineAbstractType(), llvm::StructType::refineAbstractType(), llvm::VectorType::refineAbstractType(), llvm::ArrayType::refineAbstractType(), llvm::FunctionType::refineAbstractType(), llvm::DerivedType::refineAbstractTypeTo(), removeAbstractTypeUser(), llvm::ConstantStruct::replaceUsesOfWithOnConstant(), llvm::ConstantArray::replaceUsesOfWithOnConstant(), llvm::ExecutionEngine::runFunctionAsMain(), llvm::PointerType::typeBecameConcrete(), llvm::StructType::typeBecameConcrete(), llvm::VectorType::typeBecameConcrete(), llvm::ArrayType::typeBecameConcrete(), llvm::FunctionType::typeBecameConcrete(), TypeToFloatSemantics(), llvm::DerivedType::unlockedRefineAbstractTypeTo(), UpgradeIntrinsicFunction1(), llvm::Value::Value(), llvm::InlineAsm::Verify(), WriteConstants(), and llvm::MDNode::~MDNode().

TypeID llvm::Type::getTypeID (  )  const [inline]

getTypeID - Return the type id for the type. This will return one of the TypeID enum elements defined above.

Definition at line 191 of file Type.h.

References ID.

Referenced by llvm::OpaqueType::classof(), llvm::PointerType::classof(), llvm::VectorType::classof(), llvm::ArrayType::classof(), llvm::SequentialType::classof(), llvm::StructType::classof(), llvm::CompositeType::classof(), llvm::FunctionType::classof(), llvm::IntegerType::classof(), CompareTypes(), llvm::ConstantArray::ConstantArray(), llvm::ConstantStruct::ConstantStruct(), llvm::ConstantVector::ConstantVector(), executeFAddInst(), executeFCMP_OEQ(), executeFCMP_OGE(), executeFCMP_OGT(), executeFCMP_OLE(), executeFCMP_OLT(), executeFCMP_ONE(), executeFDivInst(), executeFMulInst(), executeFRemInst(), executeFSubInst(), executeICMP_EQ(), executeICMP_NE(), executeICMP_SGE(), executeICMP_SGT(), executeICMP_SLE(), executeICMP_SLT(), executeICMP_UGE(), executeICMP_UGT(), executeICMP_ULE(), executeICMP_ULT(), ffiInvoke(), ffiTypeFor(), ffiValueFor(), llvm::MSILWriter::getArrayTypeName(), llvm::ExecutionEngine::getConstantValue(), llvm::EVT::getEVT(), getFloatBitCastField(), llvm::ConstantExpr::getFPExtend(), llvm::ConstantExpr::getFPToSI(), llvm::ConstantExpr::getFPToUI(), llvm::ConstantExpr::getFPTrunc(), llvm::Constant::getNullValue(), getPrimitiveSizeInBits(), llvm::MSILWriter::getPrimitiveTypeName(), llvm::ConstantExpr::getSExt(), llvm::ConstantExpr::getSIToFP(), llvm::getSubElementHash(), llvm::ConstantExpr::getTrunc(), getTypeID(), llvm::MSILWriter::getTypeName(), llvm::MSILWriter::getTypePostfix(), getTypePrefix(), llvm::TargetData::getTypeSizeInBits(), llvm::ConstantExpr::getUIToFP(), llvm::ConstantExpr::getZExt(), hash(), llvm::MachOWriter::InitMem(), llvm::PIC16TargetLowering::InitReservedFrameCount(), isEquivalentType(), llvm::XCoreTargetLowering::isLegalAddressingMode(), llvm::ConstantFP::isValueValidForType(), llvm::ExecutionEngine::LoadValueFromMemory(), llvm::AsmPrinter::printDataDirective(), llvm::MSILWriter::printModuleStartup(), llvm::MSILWriter::printStaticConstant(), llvm::MSILWriter::printStaticInitializer(), RecursiveResolveTypesI(), ReplaceFPIntrinsicWithCall(), llvm::JIT::runFunction(), llvm::ExecutionEngine::StoreValueToMemory(), TypesEqual(), llvm::Interpreter::visitVAArgInst(), and WriteTypeTable().

std::string Type::getDescription (  )  const

bool llvm::Type::isInteger (  )  const [inline]

bool Type::isIntOrIntVector (  )  const

bool llvm::Type::isFloatingPoint (  )  const [inline]

bool Type::isFPOrFPVector (  )  const

bool llvm::Type::isAbstract (  )  const [inline]

bool Type::canLosslesslyBitCastTo ( const Type *  Ty  )  const

Determine if this type could be losslessly bitcast to Ty.

canLosslesslyBitCastTo - Return true if this type could be converted with a lossless BitCast to type 'Ty'. For example, i8* to i32*. BitCasts are valid for types of the same size only where no re-interpretation of the bits is done.

Definition at line 149 of file Type.cpp.

References isFirstClassType().

bool llvm::Type::isPrimitiveType (  )  const [inline]

Here are some useful little methods to query what type derived types are Note that all other types can just compare to see if this == Type::xxxTy;

Definition at line 230 of file Type.h.

References ID, and LastPrimitiveTyID.

Referenced by AddModuleTypesToPrinter(), llvm::MSILWriter::getTypeName(), and ShouldNukeSymtabEntry().

bool llvm::Type::isDerivedType (  )  const [inline]

Definition at line 231 of file Type.h.

References FirstDerivedTyID, and ID.

Referenced by llvm::DerivedType::classof().

bool llvm::Type::isFirstClassType (  )  const [inline]

bool llvm::Type::isSingleValueType (  )  const [inline]

isSingleValueType - Return true if the type is a valid type for a virtual register in codegen. This includes all first-class types except struct and array types.

Definition at line 246 of file Type.h.

References ID, IntegerTyID, LastPrimitiveTyID, PointerTyID, VectorTyID, and VoidTyID.

Referenced by llvm::SDISelAsmOperandInfo::getCallOperandValEVT(), and llvm::MachOWriter::InitMem().

bool llvm::Type::isAggregateType (  )  const [inline]

isAggregateType - Return true if the type is an aggregate type. This means it is valid as the first operand of an insertvalue or extractvalue instruction. This includes struct and array types, but does not include vector types.

Definition at line 256 of file Type.h.

References ArrayTyID, ID, and StructTyID.

Referenced by llvm::SelectionDAGLowering::getValue().

bool llvm::Type::isSized (  )  const [inline]

isSized - Return true if it makes sense to take the size of this type. To get the actual size for a particular target, it is reasonable to use the TargetData subsystem to do this.

Definition at line 264 of file Type.h.

References ArrayTyID, ID, IntegerTyID, isAbstract(), isFloatingPoint(), PointerTyID, StructTyID, and VectorTyID.

Referenced by llvm::ComputeMaskedBits(), FindElementAtOffset(), llvm::ScalarEvolution::getAllocSizeExpr(), llvm::SDISelAsmOperandInfo::getCallOperandValEVT(), getIndexedTypeInternal(), llvm::TargetData::getTypeSizeInBits(), isObjectSmallerThan(), isSafeToEliminateVarargsCast(), and TryToOptimizeStoreOfMallocToGlobal().

unsigned Type::getPrimitiveSizeInBits (  )  const

getPrimitiveSizeInBits - Return the basic size of this type if it is a primitive type. These are fixed by LLVM and are not target dependent. This will return zero if the type does not have a size or is not a primitive type.

Note that this may not reflect the size of memory allocated for an instance of the type or the number of bytes that are written when an instance of the type is stored to memory. The TargetData class provides additional query functions to provide this information.

Definition at line 172 of file Type.cpp.

References DoubleTyID, FloatTyID, FP128TyID, getTypeID(), IntegerTyID, PPC_FP128TyID, VectorTyID, and X86_FP80TyID.

Referenced by llvm::CastInst::castIsValid(), CollectBSwapParts(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldGetElementPtr(), EvaluateGEPOffsetExpression(), FoldBitCast(), llvm::ConstantExpr::getBitCast(), llvm::MSILWriter::getBitWidth(), llvm::VectorType::getExtendedElementVectorType(), llvm::VectorType::getInteger(), getScalarSizeInBits(), llvm::VectorType::getTruncatedElementVectorType(), llvm::ScalarEvolution::getTypeSizeInBits(), InstCombineLoadCast(), isSafeIntegerType(), isSignBitCheck(), llvm::X86TargetLowering::isTruncateFree(), LowerBSWAP(), LowerCTLZ(), LowerCTPOP(), and MergeInType().

unsigned Type::getScalarSizeInBits (  )  const

int Type::getFPMantissaWidth (  )  const

getFPMantissaWidth - Return the width of the mantissa of this type. This is only valid on floating point types. If the FP type does not have a stable mantissa (e.g. ppc long double), this method returns -1.

getFPMantissaWidth - Return the width of the mantissa of this type. This is only valid on floating point types. If the FP type does not have a stable mantissa (e.g. ppc long double), this method returns -1.

Definition at line 195 of file Type.cpp.

References DoubleTyID, FloatTyID, FP128TyID, isFloatingPoint(), PPC_FP128TyID, and X86_FP80TyID.

const Type* llvm::Type::getForwardedType (  )  const [inline]

getForwardedType - Return the type that this type has been resolved to if it has been resolved to anything. This is used to implement the union-find algorithm for type resolution, and shouldn't be used by general purpose clients.

Definition at line 303 of file Type.h.

References ForwardType.

Referenced by llvm::PATypeHolder::get(), and getIndexedTypeInternal().

const Type * Type::getVAArgsPromotedType ( LLVMContext &  C  )  const

getVAArgsPromotedType - Return the type an argument of this type will be promoted to if passed through a variable argument function.

Definition at line 106 of file Type.cpp.

References FloatTyID, getDoubleTy(), getInt32Ty(), getSubclassData(), and IntegerTyID.

const Type * Type::getScalarType (  )  const

getScalarType - If this is a vector type, return the element type, otherwise return this.

getScalarType - If this is a vector type, return the element type, otherwise return this.

Definition at line 117 of file Type.cpp.

Referenced by llvm::ComputeMaskedBits(), llvm::ComputeNumSignBits(), llvm::ConstantFP::get(), llvm::ConstantInt::get(), llvm::Constant::getIntegerValue(), and getScalarSizeInBits().

subtype_iterator llvm::Type::subtype_begin (  )  const [inline]

subtype_iterator llvm::Type::subtype_end (  )  const [inline]

const Type* llvm::Type::getContainedType ( unsigned  i  )  const [inline]

getContainedType - This method is used to implement the type iterator (defined a the end of the file). For derived types, this returns the types 'contained' in the derived type.

Definition at line 328 of file Type.h.

References ContainedTys, llvm::PATypeHandle::get(), and NumContainedTys.

Referenced by lookupFunction().

unsigned llvm::Type::getNumContainedTypes (  )  const [inline]

getNumContainedTypes - Return the number of types in the derived type.

Definition at line 335 of file Type.h.

References NumContainedTys.

Referenced by lookupFunction(), and RecursiveResolveTypesI().

const Type * Type::getPrimitiveType ( LLVMContext &  C,
TypeID  IDNumber 
) [static]

getPrimitiveType - Return a type based on an identifier.

Definition at line 91 of file Type.cpp.

References DoubleTyID, FloatTyID, FP128TyID, getDoubleTy(), getFloatTy(), getFP128Ty(), getLabelTy(), getMetadataTy(), getPPC_FP128Ty(), getVoidTy(), getX86_FP80Ty(), LabelTyID, MetadataTyID, PPC_FP128TyID, VoidTyID, and X86_FP80TyID.

const Type * Type::getVoidTy ( LLVMContext &  C  )  [static]

const Type * Type::getLabelTy ( LLVMContext &  C  )  [static]

const Type * Type::getFloatTy ( LLVMContext &  C  )  [static]

const Type * Type::getDoubleTy ( LLVMContext &  C  )  [static]

const Type * Type::getMetadataTy ( LLVMContext &  C  )  [static]

const Type * Type::getX86_FP80Ty ( LLVMContext &  C  )  [static]

const Type * Type::getFP128Ty ( LLVMContext &  C  )  [static]

const Type * Type::getPPC_FP128Ty ( LLVMContext &  C  )  [static]

const IntegerType * Type::getInt1Ty ( LLVMContext &  C  )  [static]

const IntegerType * Type::getInt8Ty ( LLVMContext &  C  )  [static]

const IntegerType * Type::getInt16Ty ( LLVMContext &  C  )  [static]

const IntegerType * Type::getInt32Ty ( LLVMContext &  C  )  [static]

Definition at line 350 of file Type.cpp.

References llvm::LLVMContextImpl::Int32Ty, and llvm::LLVMContext::pImpl.

Referenced by llvm::IntrinsicLowering::AddPrototypes(), ByteswapSCANFResults(), llvm::DIFactory::CreateBasicType(), llvm::DIFactory::CreateCompileUnit(), llvm::DIFactory::CreateCompositeType(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateConstGEP1_32(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateConstGEP2_32(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateConstInBoundsGEP1_32(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateConstInBoundsGEP2_32(), llvm::DIFactory::CreateDerivedType(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateGlobalStringPtr(), llvm::DIFactory::CreateGlobalVariable(), llvm::DIFactory::CreateSubprogram(), llvm::DIFactory::CreateVariable(), llvm::PointerTracking::doInitialization(), llvm::DerivedType::dropAllTypeUses(), llvm::Thumb2RegisterInfo::emitLoadConstPool(), llvm::Thumb1RegisterInfo::emitLoadConstPool(), llvm::ARMBaseRegisterInfo::emitLoadConstPool(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::IntegerType::get(), getAISize(), llvm::ConstantExpr::getAlignOf(), llvm::ExecutionEngine::getConstantValue(), llvm::ConstantExpr::getExtractElement(), llvm::TargetData::getIndexedOffset(), llvm::ConstantExpr::getInsertElement(), llvm::IRBuilder< true, llvm::TargetFolder >::getInt32Ty(), llvm::SelectionDAG::getMemset(), llvm::ConstantExpr::getOffsetOf(), llvm::ConstantExpr::getSizeOf(), llvm::EVT::getTypeForEVT(), getVAArgsPromotedType(), GetZeroSCEV(), llvm::RSProfilers_std::IncrementCounterInBlock(), llvm::IncrementCounterInBlock(), llvm::StructType::indexValid(), llvm::InlineFunction(), llvm::InsertProfilingInitCall(), llvm::DIFactory::InsertStopPoint(), llvm::ShuffleVectorInst::isValidOperands(), llvm::InsertElementInst::isValidOperands(), llvm::ExtractElementInst::isValidOperands(), llvm::X86TargetLowering::isZExtFree(), llvm::X86TargetLowering::LowerAsmOperandForConstraint(), LowerBSWAP(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::MachineFunction::MachineFunction(), OptimizeGlobalAddressOfMalloc(), llvm::JIT::runFunction(), llvm::ExecutionEngine::runFunctionAsMain(), SRAGlobal(), TryToOptimizeStoreOfMallocToGlobal(), and llvm::UpgradeIntrinsicCall().

const IntegerType * Type::getInt64Ty ( LLVMContext &  C  )  [static]

static bool llvm::Type::classof ( const Type *   )  [inline, static]

Methods for support type inquiry through isa, cast, and dyn_cast:.

Reimplemented in llvm::DerivedType, llvm::IntegerType, llvm::FunctionType, llvm::CompositeType, llvm::StructType, llvm::SequentialType, llvm::ArrayType, llvm::VectorType, llvm::PointerType, and llvm::OpaqueType.

Definition at line 363 of file Type.h.

void llvm::Type::addRef (  )  const [inline]

void llvm::Type::dropRef (  )  const [inline]

Definition at line 370 of file Type.h.

References AbstractTypeUsers, llvm::sys::AtomicDecrement(), isAbstract(), and RefCount.

void Type::addAbstractTypeUser ( AbstractTypeUser *  U  )  const

addAbstractTypeUser - Notify an abstract type that there is a new user of it. This function is called primarily by the PATypeHandle class.

Definition at line 975 of file Type.cpp.

References AbstractTypeUsers, llvm::LLVMContextImpl::AbstractTypeUsersLock, llvm::sys::SmartMutex< mt_only >::acquire(), getContext(), isAbstract(), llvm::LLVMContext::pImpl, and llvm::sys::SmartMutex< mt_only >::release().

void Type::removeAbstractTypeUser ( AbstractTypeUser *  U  )  const

removeAbstractTypeUser - Notify an abstract type that a user of the class no longer has a handle to the type. This function is called primarily by the PATypeHandle class. When there are no users of the abstract type, it is annihilated, because there is no way to get a reference to it ever again.

Definition at line 989 of file Type.cpp.

References AbstractTypeUsers, llvm::LLVMContextImpl::AbstractTypeUsersLock, llvm::sys::SmartMutex< mt_only >::acquire(), DOUT, getContext(), getRefCount(), isAbstract(), llvm::LLVMContext::pImpl, and llvm::sys::SmartMutex< mt_only >::release().

Referenced by llvm::TypeMapBase::TypeBecameConcrete(), and llvm::ValueMap< std::vector< llvm::Constant * >, llvm::StructType, llvm::ConstantStruct, true >::typeBecameConcrete().

PointerType * Type::getPointerTo ( unsigned  AddrSpace = 0  )  const

getPointerTo - Return a pointer to the current type. This is equivalent to PointerType::get(Foo, AddrSpace).

Definition at line 952 of file Type.cpp.

References llvm::PointerType::get().

Referenced by llvm::ConstantExpr::getAlignOf().

void Type::PromoteAbstractToConcrete (  )  [protected]


Friends And Related Function Documentation

friend class LLVMContextImpl [friend]

Reimplemented in llvm::IntegerType.

Definition at line 112 of file Type.h.

friend class TypeMapBase [friend]

Definition at line 411 of file Type.h.


Member Data Documentation

const Type* llvm::Type::ForwardType [mutable, protected]

ForwardType - This field is used to implement the union find scheme for abstract types. When types are refined to other types, this field is set to the more refined type. Only abstract types can be forwarded.

Definition at line 142 of file Type.h.

Referenced by getForwardedType(), and llvm::DerivedType::unlockedRefineAbstractTypeTo().

std::vector<AbstractTypeUser *> llvm::Type::AbstractTypeUsers [mutable, protected]

AbstractTypeUsers - Implement a list of the users that need to be notified if I am a type, and I get resolved into a more concrete type.

Definition at line 148 of file Type.h.

Referenced by addAbstractTypeUser(), dropRef(), llvm::DerivedType::notifyUsesThatTypeBecameConcrete(), removeAbstractTypeUser(), llvm::DerivedType::unlockedRefineAbstractTypeTo(), ~Type(), and llvm::TypeMapBase::~TypeMapBase().

NumContainedTys - Keeps track of how many PATypeHandle instances there are at the end of this type instance for the list of contained types. It is the subclasses responsibility to set this up. Set to 0 if there are no contained types in this type.

Definition at line 154 of file Type.h.

Referenced by llvm::StructType::element_end(), getContainedType(), llvm::StructType::getElementType(), getNumContainedTypes(), llvm::StructType::getNumElements(), llvm::FunctionType::getNumParams(), llvm::FunctionType::param_end(), llvm::SequentialType::SequentialType(), and subtype_end().

ContainedTys - A pointer to the array of Types (PATypeHandle) contained by this Type. For example, this includes the arguments of a function type, the elements of a structure, the pointee of a pointer, the element type of an array, etc. This pointer may be 0 for types that don't contain other types (Integer, Double, Float). In general, the subclass should arrange for space for the PATypeHandles to be included in the allocation of the type object and set this pointer to the address of the first element. This allows the Type class to manipulate the ContainedTys without understanding the subclass's placement for this array. keeping it here also allows the subtype_* members to be implemented MUCH more efficiently, and dynamically very few types do not contain any elements.

Definition at line 167 of file Type.h.

Referenced by llvm::DerivedType::dropAllTypeUses(), llvm::StructType::element_begin(), llvm::StructType::element_end(), getContainedType(), llvm::SequentialType::getElementType(), llvm::StructType::getElementType(), llvm::FunctionType::getParamType(), llvm::FunctionType::getReturnType(), llvm::SequentialType::getTypeAtIndex(), llvm::StructType::getTypeAtIndex(), llvm::FunctionType::param_begin(), llvm::FunctionType::param_end(), llvm::SequentialType::SequentialType(), subtype_begin(), and subtype_end().


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