LLVM API Documentation

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

#include <Type.h>

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

Public Types

enum  TypeID {
  VoidTyID = 0, HalfTyID, FloatTyID, DoubleTyID,
  X86_FP80TyID, FP128TyID, PPC_FP128TyID, LabelTyID,
  MetadataTyID, X86_MMXTyID, IntegerTyID, FunctionTyID,
  StructTyID, ArrayTyID, PointerTyID, VectorTyID,
  NumTypeIDs, LastPrimitiveTyID = X86_MMXTyID, FirstDerivedTyID = IntegerTyID
}
 
typedef Type *const * subtype_iterator
 
typedef std::reverse_iterator
< subtype_iterator
subtype_reverse_iterator
 

Public Member Functions

void print (raw_ostream &O) const
 
void dump () const
 
LLVMContextgetContext () const
 getContext - Return the LLVMContext in which this type was uniqued. More...
 
TypeID getTypeID () const
 
bool isVoidTy () const
 isVoidTy - Return true if this is 'void'. More...
 
bool isHalfTy () const
 isHalfTy - Return true if this is 'half', a 16-bit IEEE fp type. More...
 
bool isFloatTy () const
 isFloatTy - Return true if this is 'float', a 32-bit IEEE fp type. More...
 
bool isDoubleTy () const
 isDoubleTy - Return true if this is 'double', a 64-bit IEEE fp type. More...
 
bool isX86_FP80Ty () const
 isX86_FP80Ty - Return true if this is x86 long double. More...
 
bool isFP128Ty () const
 isFP128Ty - Return true if this is 'fp128'. More...
 
bool isPPC_FP128Ty () const
 isPPC_FP128Ty - Return true if this is powerpc long double. More...
 
bool isFloatingPointTy () const
 
const fltSemanticsgetFltSemantics () const
 
bool isX86_MMXTy () const
 isX86_MMXTy - Return true if this is X86 MMX. More...
 
bool isFPOrFPVectorTy () const
 
bool isLabelTy () const
 isLabelTy - Return true if this is 'label'. More...
 
bool isMetadataTy () const
 isMetadataTy - Return true if this is 'metadata'. More...
 
bool isIntegerTy () const
 
bool isIntegerTy (unsigned Bitwidth) const
 isIntegerTy - Return true if this is an IntegerType of the given width. More...
 
bool isIntOrIntVectorTy () const
 
bool isFunctionTy () const
 
bool isStructTy () const
 
bool isArrayTy () const
 
bool isPointerTy () const
 
bool isPtrOrPtrVectorTy () const
 
bool isVectorTy () const
 
bool canLosslesslyBitCastTo (Type *Ty) const
 Determine if this type could be losslessly bitcast to Ty. More...
 
bool isEmptyTy () const
 
bool isPrimitiveType () const
 
bool isDerivedType () const
 
bool isFirstClassType () const
 
bool isSingleValueType () const
 
bool isAggregateType () const
 
bool isSized () const
 
unsigned getPrimitiveSizeInBits () const
 
unsigned getScalarSizeInBits ()
 
int getFPMantissaWidth () const
 
const TypegetScalarType () const
 
TypegetScalarType ()
 
subtype_iterator subtype_begin () const
 
subtype_iterator subtype_end () const
 
subtype_reverse_iterator subtype_rbegin () const
 
subtype_reverse_iterator subtype_rend () const
 
TypegetContainedType (unsigned i) const
 
unsigned getNumContainedTypes () const
 
unsigned getIntegerBitWidth () const
 
TypegetFunctionParamType (unsigned i) const
 
unsigned getFunctionNumParams () const
 
bool isFunctionVarArg () const
 
StringRef getStructName () const
 
unsigned getStructNumElements () const
 
TypegetStructElementType (unsigned N) const
 
TypegetSequentialElementType () const
 
uint64_t getArrayNumElements () const
 
TypegetArrayElementType () const
 
unsigned getVectorNumElements () const
 
TypegetVectorElementType () const
 
TypegetPointerElementType () const
 
unsigned getPointerAddressSpace () const
 Get the address space of this pointer or pointer vector type. More...
 
PointerTypegetPointerTo (unsigned AddrSpace=0)
 

Static Public Member Functions

static TypegetPrimitiveType (LLVMContext &C, TypeID IDNumber)
 getPrimitiveType - Return a type based on an identifier. More...
 
static TypegetVoidTy (LLVMContext &C)
 
static TypegetLabelTy (LLVMContext &C)
 
static TypegetHalfTy (LLVMContext &C)
 
static TypegetFloatTy (LLVMContext &C)
 
static TypegetDoubleTy (LLVMContext &C)
 
static TypegetMetadataTy (LLVMContext &C)
 
static TypegetX86_FP80Ty (LLVMContext &C)
 
static TypegetFP128Ty (LLVMContext &C)
 
static TypegetPPC_FP128Ty (LLVMContext &C)
 
static TypegetX86_MMXTy (LLVMContext &C)
 
static IntegerTypegetIntNTy (LLVMContext &C, unsigned N)
 
static IntegerTypegetInt1Ty (LLVMContext &C)
 
static IntegerTypegetInt8Ty (LLVMContext &C)
 
static IntegerTypegetInt16Ty (LLVMContext &C)
 
static IntegerTypegetInt32Ty (LLVMContext &C)
 
static IntegerTypegetInt64Ty (LLVMContext &C)
 
static PointerTypegetHalfPtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetFloatPtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetDoublePtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetX86_FP80PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetFP128PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetPPC_FP128PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetX86_MMXPtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetIntNPtrTy (LLVMContext &C, unsigned N, unsigned AS=0)
 
static PointerTypegetInt1PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetInt8PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetInt16PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetInt32PtrTy (LLVMContext &C, unsigned AS=0)
 
static PointerTypegetInt64PtrTy (LLVMContext &C, unsigned AS=0)
 

Protected Member Functions

 Type (LLVMContext &C, TypeID tid)
 
 ~Type ()
 
void setTypeID (TypeID ID)
 
unsigned getSubclassData () const
 
void setSubclassData (unsigned val)
 

Protected Attributes

unsigned NumContainedTys
 
Type *const * ContainedTys
 

Friends

class LLVMContextImpl
 

Detailed Description

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.

Definition at line 44 of file Type.h.

Member Typedef Documentation

Definition at line 323 of file Type.h.

Definition at line 327 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 class defined in 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

HalfTyID 

1: 16-bit floating point type

FloatTyID 

2: 32-bit floating point type

DoubleTyID 

3: 64-bit floating point type

X86_FP80TyID 

4: 80-bit floating point type (X87)

FP128TyID 

5: 128-bit floating point type (112-bit mantissa)

PPC_FP128TyID 

6: 128-bit floating point type (two 64-bits, PowerPC)

LabelTyID 

7: Labels

MetadataTyID 

8: Metadata

X86_MMXTyID 

9: MMX vectors (64 bits, X86 specific)

IntegerTyID 

10: Arbitrary bit width integers

FunctionTyID 

11: Functions

StructTyID 

12: Structures

ArrayTyID 

13: Arrays

PointerTyID 

14: Pointers

VectorTyID 

15: SIMD 'packed' format, or other vector type

NumTypeIDs 
LastPrimitiveTyID 
FirstDerivedTyID 

Definition at line 53 of file Type.h.

Constructor & Destructor Documentation

llvm::Type::Type ( LLVMContext C,
TypeID  tid 
)
inlineexplicitprotected

Definition at line 92 of file Type.h.

References setTypeID().

llvm::Type::~Type ( )
inlineprotected

Definition at line 97 of file Type.h.

Member Function Documentation

bool Type::canLosslesslyBitCastTo ( 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 65 of file Type.cpp.

References getTypeID(), isFirstClassType(), isPointerTy(), and X86_MMXTyID.

void Type::dump ( ) const

Definition at line 2215 of file AsmWriter.cpp.

References llvm::dbgs(), and print().

Type* llvm::Type::getArrayElementType ( ) const
inline
uint64_t Type::getArrayNumElements ( ) 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 339 of file Type.h.

References ContainedTys, and NumContainedTys.

Referenced by llvm::ComputeUsesVAFloatArgument(), lookupFunction(), llvm::Interpreter::visitInsertElementInst(), llvm::Interpreter::visitShuffleVectorInst(), and whichFPReturnVariant().

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

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

Definition at line 128 of file Type.h.

Referenced by CoerceAvailableValueToLoadType(), ConstantFoldBinaryFP(), ConstantFoldFP(), ConstantFoldGetElementPtrImpl(), convertPointerToIntegerType(), llvm::StructType::create(), createAndInstr(), llvm::FunctionLoweringInfo::CreateRegs(), CvtFDivConstToReciprocal(), llvm::ConstantArray::destroyConstant(), llvm::ConstantStruct::destroyConstant(), llvm::ConstantVector::destroyConstant(), llvm::ConstantDataSequential::destroyConstant(), llvm::BlockAddress::destroyConstant(), llvm::ConstantExpr::destroyConstant(), dyn_castFoldableMul(), llvm::InstCombiner::FoldAndOfICmps(), FoldBitCast(), foldConstantCastPair(), FoldReinterpretLoadFromConstPtr(), llvm::InlineAsm::get(), llvm::ConstantInt::get(), llvm::FunctionType::get(), llvm::StructType::get(), llvm::ConstantFP::get(), llvm::ConstantAggregateZero::get(), llvm::ArrayType::get(), llvm::ConstantArray::get(), llvm::VectorType::get(), llvm::ConstantStruct::get(), llvm::PointerType::get(), llvm::ConstantPointerNull::get(), llvm::UndefValue::get(), llvm::ConstantExpr::getAlignOf(), getAllocationData(), llvm::Constant::getAllOnesValue(), llvm::BasicBlock::getContext(), llvm::Value::getContext(), llvm::Function::getContext(), llvm::EVT::getEVT(), llvm::VectorType::getExtendedElementVectorType(), llvm::ConstantInt::getFalse(), llvm::ConstantExpr::getFCmp(), getFoldedCast(), llvm::ConstantExpr::getICmp(), llvm::ConstantDataSequential::getImpl(), llvm::DataLayout::getIndexedOffset(), llvm::ConstantFP::getInfinity(), llvm::VectorType::getInteger(), llvm::Constant::getIntegerValue(), llvm::DataLayout::getIntPtrType(), GetLoadValueForLoad(), GetMemInstValueForLoad(), llvm::ConstantFP::getNegativeZero(), llvm::Constant::getNullValue(), llvm::ConstantExpr::getOffsetOf(), getPromotedType(), llvm::GetReturnInfo(), llvm::ConstantExpr::getShuffleVector(), llvm::ConstantExpr::getSizeOf(), GetStoreValueForLoad(), llvm::AArch64TargetLowering::getTgtMemIntrinsic(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), llvm::ConstantInt::getTrue(), llvm::VectorType::getTruncatedElementVectorType(), llvm::TargetLoweringBase::getTypeLegalizationCost(), getTypePartition(), llvm::TargetLoweringBase::getValueType(), hasLifetimeMarkers(), isIntegerWideningViable(), isVectorPromotionViableForSlice(), LLVMConstIntOfArbitraryPrecision(), llvm::TargetLowering::LowerCallTo(), llvm::CmpInst::makeCmpResultType(), llvm::TargetLowering::ParseConstraints(), llvm::AssemblyWriter::printInstruction(), llvm::ConstantArray::replaceUsesOfWithOnConstant(), llvm::StructType::setBody(), llvm::StructType::setName(), SymbolicallyEvaluateGEP(), and llvm::AttributeFuncs::typeIncompatible().

PointerType * Type::getDoublePtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 256 of file Type.cpp.

References getDoubleTy(), and getPointerTo().

Type * Type::getDoubleTy ( LLVMContext C)
static
PointerType * Type::getFloatPtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 252 of file Type.cpp.

References getFloatTy(), and getPointerTo().

Type * Type::getFloatTy ( LLVMContext C)
static
const fltSemantics& llvm::Type::getFltSemantics ( ) const
inline
PointerType * Type::getFP128PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 264 of file Type.cpp.

References getFP128Ty(), and getPointerTo().

Type * Type::getFP128Ty ( LLVMContext C)
static
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.

Definition at line 142 of file Type.cpp.

References DoubleTyID, FloatTyID, FP128TyID, getTypeID(), HalfTyID, isFloatingPointTy(), PPC_FP128TyID, and X86_FP80TyID.

Referenced by llvm::InstCombiner::FoldFCmp_IntToFP_Cst(), llvm::InstCombiner::visitFPToSI(), and llvm::InstCombiner::visitFPToUI().

unsigned Type::getFunctionNumParams ( ) const

Definition at line 190 of file Type.cpp.

Type * Type::getFunctionParamType ( unsigned  i) const

Definition at line 186 of file Type.cpp.

PointerType * Type::getHalfPtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 248 of file Type.cpp.

References getHalfTy(), and getPointerTo().

Type * Type::getHalfTy ( LLVMContext C)
static
PointerType * Type::getInt16PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 288 of file Type.cpp.

References getInt16Ty(), and getPointerTo().

Referenced by FoldReinterpretLoadFromConstPtr().

IntegerType * Type::getInt16Ty ( LLVMContext C)
static
PointerType * Type::getInt1PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 280 of file Type.cpp.

References getInt1Ty(), and getPointerTo().

Referenced by llvm::SCEVExpander::getIVIncOperand(), and llvm::InstCombiner::visitFree().

IntegerType * Type::getInt1Ty ( LLVMContext C)
static
PointerType * Type::getInt32PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 292 of file Type.cpp.

References getInt32Ty(), and getPointerTo().

Referenced by FoldReinterpretLoadFromConstPtr().

IntegerType * Type::getInt32Ty ( LLVMContext C)
static

Definition at line 241 of file Type.cpp.

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

Referenced by llvm::Module::addModuleFlag(), llvm::IntrinsicLowering::AddPrototypes(), AddWithOverflow(), BuildConstantFromSCEV(), llvm::cleanseInlinedVariable(), CollectShuffleElements(), CollectSingleShuffleElements(), convertPointerToIntegerType(), llvm::ARMConstantPoolConstant::Create(), llvm::DIBuilder::createArrayType(), llvm::DIBuilder::createArtificialType(), llvm::DIBuilder::createBasicType(), llvm::MDBuilder::createBranchWeights(), llvm::DIBuilder::createClassType(), llvm::DIBuilder::createCompileUnit(), llvm::DIBuilder::createComplexVariable(), llvm::IRBuilder< true, TargetFolder >::CreateConstGEP1_32(), llvm::IRBuilder< true, TargetFolder >::CreateConstGEP2_32(), llvm::IRBuilder< true, TargetFolder >::CreateConstInBoundsGEP1_32(), llvm::IRBuilder< true, TargetFolder >::CreateConstInBoundsGEP2_32(), llvm::DIBuilder::createEnumerationType(), llvm::DIBuilder::createForwardDecl(), llvm::DIBuilder::createFriend(), llvm::DIBuilder::createFunction(), llvm::IRBuilder< true, TargetFolder >::CreateGlobalStringPtr(), llvm::DIBuilder::createGlobalVariable(), llvm::DIBuilder::createImportedDeclaration(), createImportedModule(), llvm::DIBuilder::createInheritance(), llvm::DIBuilder::createLexicalBlock(), llvm::DIBuilder::createLocalVariable(), llvm::DIBuilder::createMemberPointerType(), llvm::DIBuilder::createMemberType(), llvm::DIBuilder::createMethod(), llvm::DIBuilder::createNameSpace(), llvm::DIBuilder::createObjCIVar(), llvm::DIBuilder::createObjCProperty(), llvm::DIBuilder::createObjectPointerType(), llvm::DIBuilder::createPointerType(), CreatePrologue(), llvm::DIBuilder::createQualifiedType(), llvm::DIBuilder::createReferenceType(), llvm::DIBuilder::createStaticMemberType(), llvm::DIBuilder::createStaticVariable(), llvm::DIBuilder::createStructType(), llvm::DIBuilder::createSubroutineType(), llvm::DIBuilder::createTemplateTypeParameter(), llvm::DIBuilder::createTypedef(), llvm::DIBuilder::createUnionType(), llvm::DIBuilder::createUnspecifiedType(), llvm::DIBuilder::createVectorType(), llvm::Thumb2RegisterInfo::emitLoadConstPool(), llvm::Thumb1RegisterInfo::emitLoadConstPool(), llvm::ARMBaseRegisterInfo::emitLoadConstPool(), llvm::ARMSelectionDAGInfo::EmitTargetCodeForMemset(), FoldBitCast(), llvm::InstCombiner::FoldCmpLoadFromIndexedGlobal(), llvm::X86InstrInfo::foldMemoryOperandImpl(), llvm::IntegerType::get(), llvm::ConstantDataArray::get(), llvm::ConstantDataVector::get(), getAISize(), llvm::ConstantExpr::getAlignOf(), llvm::DebugLoc::getAsMDNode(), llvm::DataLayout::getIndexedOffset(), getInt32PtrTy(), llvm::IRBuilderBase::getInt32Ty(), llvm::SelectionDAG::getMemset(), llvm::ConstantExpr::getOffsetOf(), llvm::DIBuilder::getOrCreateArray(), getPromotedType(), llvm::ConstantExpr::getSizeOf(), GetTagConstant(), llvm::EVT::getTypeForEVT(), HandleByValArgument(), InstallGlobalCtors(), InstCombineStoreToCast(), llvm::isBytewiseValue(), LLVMBuildArrayMalloc(), LLVMBuildMalloc(), LLVMInt32TypeInContext(), llvm::X86TargetLowering::LowerAsmOperandForConstraint(), LowerBSWAP(), llvm::SparcTargetLowering::LowerF128Compare(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::MergeBasicBlockIntoOnlyPred(), ReadDataFromGlobal(), llvm::JIT::runFunction(), llvm::NVPTXLowerAggrCopies::runOnFunction(), SRAGlobal(), SubWithOverflow(), SymbolicallyEvaluateGEP(), llvm::UpgradeIntrinsicCall(), llvm::InstCombiner::visitBitCast(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitExtractElementInst(), llvm::InstCombiner::visitShuffleVectorInst(), and llvm::BasicBlock::~BasicBlock().

PointerType * Type::getInt64PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 296 of file Type.cpp.

References getInt64Ty(), and getPointerTo().

Referenced by FoldReinterpretLoadFromConstPtr().

IntegerType * Type::getInt64Ty ( LLVMContext C)
static

Definition at line 242 of file Type.cpp.

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

Referenced by AnalyzeLoadFromClobberingMemInst(), ConstantFoldGetElementPtrImpl(), llvm::DIBuilder::createArrayType(), llvm::DIBuilder::createBasicType(), llvm::DIBuilder::createClassType(), llvm::IRBuilder< true, TargetFolder >::CreateConstGEP1_64(), llvm::IRBuilder< true, TargetFolder >::CreateConstGEP2_64(), llvm::IRBuilder< true, TargetFolder >::CreateConstInBoundsGEP1_64(), llvm::IRBuilder< true, TargetFolder >::CreateConstInBoundsGEP2_64(), llvm::DIBuilder::createEnumerationType(), llvm::DIBuilder::createEnumerator(), llvm::DIBuilder::createForwardDecl(), llvm::DIBuilder::createFriend(), llvm::DIBuilder::createInheritance(), llvm::DIBuilder::createMemberPointerType(), llvm::DIBuilder::createMemberType(), llvm::DIBuilder::createObjCIVar(), llvm::DIBuilder::createPointerType(), llvm::IRBuilder< true, TargetFolder >::CreatePtrDiff(), llvm::DIBuilder::createQualifiedType(), llvm::DIBuilder::createReferenceType(), llvm::DIBuilder::createStaticMemberType(), llvm::DIBuilder::createStructType(), llvm::DIBuilder::createSubroutineType(), llvm::MDBuilder::createTBAANode(), llvm::DIBuilder::createTypedef(), llvm::DIBuilder::createUnionType(), llvm::DIBuilder::createUnspecifiedType(), llvm::DIBuilder::createVectorType(), foldConstantCastPair(), genLoopLimit(), llvm::IntegerType::get(), llvm::ConstantDataArray::get(), llvm::ConstantDataVector::get(), llvm::ConstantExpr::getAlignOf(), llvm::ScalarEvolution::getEffectiveSCEVType(), getInt64PtrTy(), llvm::IRBuilderBase::getInt64Ty(), GetMemInstValueForLoad(), llvm::ConstantExpr::getOffsetOf(), llvm::DIBuilder::getOrCreateSubrange(), llvm::ConstantExpr::getSizeOf(), llvm::EVT::getTypeForEVT(), HandleByValArgument(), IdxCompare(), llvm::InlineFunction(), llvm::DIBuilder::insertDbgValueIntrinsic(), InstCombineLoadCast(), llvm::isBytewiseValue(), LLVMInt64TypeInContext(), LowerBSWAP(), llvm::IntrinsicLowering::LowerIntrinsicCall(), ReadDataFromGlobal(), llvm::replaceDbgDeclareForAlloca(), llvm::JIT::runFunction(), llvm::UpgradeBitCastExpr(), llvm::UpgradeBitCastInst(), llvm::UpgradeInstWithTBAATag(), llvm::UpgradeIntrinsicCall(), and llvm::InstCombiner::visitAllocaInst().

PointerType * Type::getInt8PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static
IntegerType * Type::getInt8Ty ( LLVMContext C)
static
unsigned Type::getIntegerBitWidth ( ) const
PointerType * Type::getIntNPtrTy ( LLVMContext C,
unsigned  N,
unsigned  AS = 0 
)
static

Definition at line 276 of file Type.cpp.

References getIntNTy(), and getPointerTo().

Referenced by FoldReinterpretLoadFromConstPtr().

IntegerType * Type::getIntNTy ( LLVMContext C,
unsigned  N 
)
static
Type * Type::getLabelTy ( LLVMContext C)
static

Definition at line 228 of file Type.cpp.

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

Referenced by getPrimitiveType(), and LLVMLabelTypeInContext().

Type * Type::getMetadataTy ( LLVMContext C)
static
unsigned llvm::Type::getNumContainedTypes ( ) const
inline

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

Definition at line 346 of file Type.h.

References NumContainedTys.

Referenced by lookupFunction(), and llvm::InstCombiner::visitBitCast().

unsigned Type::getPointerAddressSpace ( ) const
Type* llvm::Type::getPointerElementType ( ) const
inline
PointerType * Type::getPointerTo ( unsigned  AddrSpace = 0)
PointerType * Type::getPPC_FP128PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 268 of file Type.cpp.

References getPointerTo(), and getPPC_FP128Ty().

Type * Type::getPPC_FP128Ty ( LLVMContext C)
static
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 DataLayout class provides additional query functions to provide this information.

Definition at line 117 of file Type.cpp.

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

Referenced by llvm::HexagonTargetLowering::allowTruncateForTailCall(), llvm::ARMTargetLowering::allowTruncateForTailCall(), llvm::X86TargetLowering::allowTruncateForTailCall(), llvm::CastInst::castIsValid(), CollectBSwapParts(), CollectInsertionElements(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldLoadFromConstPtr(), EvaluateGEPOffsetExpression(), FoldBitCast(), llvm::InstCombiner::FoldCmpLoadFromIndexedGlobal(), llvm::InstCombiner::FoldGEPICmp(), llvm::InstCombiner::FoldICmpAddOpCst(), llvm::Constant::getAllOnesValue(), llvm::CastInst::getCastOpcode(), llvm::ExecutionEngine::getConstantValue(), llvm::ConstantDataSequential::getElementByteSize(), llvm::VectorType::getExtendedElementVectorType(), llvm::VectorType::getInteger(), GetLinearExpression(), llvm::MemoryDependenceAnalysis::getLoadLoadClobberFullWidthSize(), GetLoadValueForLoad(), getNoopInput(), llvm::NVPTXTargetLowering::getPrototype(), getScalarSizeInBits(), llvm::X86TargetLowering::getSingleConstraintMatchWeight(), llvm::VectorType::getTruncatedElementVectorType(), llvm::ScalarEvolution::getTypeSizeInBits(), getTypeSizeIndex(), llvm::CastInst::isBitCastable(), llvm::CastInst::isCastable(), isMultipleOfTypeSize(), llvm::MSP430TargetLowering::isTruncateFree(), llvm::SystemZTargetLowering::isTruncateFree(), llvm::X86TargetLowering::isTruncateFree(), LinearizeExprTree(), LowerBSWAP(), LowerCTLZ(), LowerCTPOP(), OptimizeIntToFloatBitCast(), OptimizeVectorResize(), ProcessUGT_ADDCST_ADD(), SimplifyICmpInst(), SwitchToLookupTable(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitICmpInstWithInstAndIntCst(), llvm::InstCombiner::visitMul(), llvm::InstCombiner::visitPHINode(), llvm::InstCombiner::visitSDiv(), llvm::InstCombiner::visitSRem(), llvm::InstCombiner::visitSub(), llvm::InstCombiner::visitTrunc(), and width_descending().

Type * Type::getPrimitiveType ( LLVMContext C,
TypeID  IDNumber 
)
static
unsigned Type::getScalarSizeInBits ( )

getScalarSizeInBits - If this is a vector type, return the getPrimitiveSizeInBits value for the element type. Otherwise return the getPrimitiveSizeInBits value for this type.

Definition at line 135 of file Type.cpp.

References getPrimitiveSizeInBits(), and getScalarType().

Referenced by CanEvaluateSExtd(), CanEvaluateShifted(), CanEvaluateTruncated(), CanEvaluateZExtd(), llvm::CastInst::castIsValid(), llvm::ComputeMaskedBits(), llvm::ComputeNumSignBits(), llvm::ConstantFoldInstOperands(), convertPointerToIntegerType(), llvm::CastInst::CreateFPCast(), llvm::CastInst::CreateIntegerCast(), llvm::CastInst::CreateSExtOrBitCast(), llvm::IRBuilder< true, TargetFolder >::CreateSExtOrTrunc(), llvm::CastInst::CreateTruncOrBitCast(), llvm::CastInst::CreateZExtOrBitCast(), llvm::IRBuilder< true, TargetFolder >::CreateZExtOrTrunc(), llvm::InstCombiner::FoldFCmp_IntToFP_Cst(), llvm::InstCombiner::FoldShiftByConstant(), getBitWidth(), llvm::ExecutionEngine::getConstantValue(), llvm::ConstantExpr::getFPCast(), llvm::ConstantExpr::getFPExtend(), llvm::ConstantExpr::getFPTrunc(), llvm::ConstantExpr::getIntegerCast(), llvm::ConstantExpr::getSExt(), llvm::ConstantExpr::getSExtOrBitCast(), GetShiftedValue(), llvm::ConstantExpr::getTrunc(), llvm::ConstantExpr::getTruncOrBitCast(), getWiderType(), llvm::ConstantExpr::getZExt(), llvm::ConstantExpr::getZExtOrBitCast(), llvm::CastInst::isEliminableCastPair(), llvm::isKnownToBeAPowerOfTwo(), llvm::CastInst::isNoopCast(), SimplifyShift(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitAShr(), llvm::InstCombiner::visitFPToSI(), llvm::InstCombiner::visitFPToUI(), llvm::InstCombiner::visitFPTrunc(), llvm::InstCombiner::visitGetElementPtrInst(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitIntToPtr(), llvm::InstCombiner::visitLShr(), llvm::InstCombiner::visitPtrToInt(), llvm::InstCombiner::visitSelectInstWithICmp(), llvm::InstCombiner::visitSExt(), llvm::InstCombiner::visitTrunc(), and llvm::InstCombiner::visitZExt().

const Type * Type::getScalarType ( ) const
Type * Type::getScalarType ( )

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

Definition at line 45 of file Type.cpp.

Type * Type::getSequentialElementType ( ) const
Type * Type::getStructElementType ( unsigned  N) const

Definition at line 202 of file Type.cpp.

StringRef Type::getStructName ( ) const

Definition at line 194 of file Type.cpp.

References llvm::Intrinsic::getName().

unsigned Type::getStructNumElements ( ) const

Definition at line 198 of file Type.cpp.

Referenced by whichFPReturnVariant().

unsigned llvm::Type::getSubclassData ( ) const
inlineprotected
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 137 of file Type.h.

Referenced by canLosslesslyBitCastTo(), llvm::IntegerType::classof(), llvm::FunctionType::classof(), llvm::CompositeType::classof(), llvm::StructType::classof(), llvm::SequentialType::classof(), llvm::ArrayType::classof(), llvm::VectorType::classof(), llvm::PointerType::classof(), llvm::isa_impl< PointerType, Type >::doit(), 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(), llvm::ExecutionEngine::getConstantValue(), llvm::EVT::getEVT(), getFltSemantics(), llvm::ConstantExpr::getFPExtend(), getFPMantissaWidth(), llvm::ConstantExpr::getFPToSI(), llvm::ConstantExpr::getFPToUI(), llvm::ConstantExpr::getFPTrunc(), llvm::Constant::getNullValue(), getPrimitiveSizeInBits(), llvm::NVPTXTargetLowering::getPrototype(), llvm::ConstantExpr::getSExt(), llvm::ConstantExpr::getSIToFP(), llvm::ConstantExpr::getTrunc(), getTypeID(), getTypeIDForHash(), getTypePrefix(), llvm::DataLayout::getTypeSizeInBits(), llvm::ConstantExpr::getUIToFP(), llvm::MVT::getVT(), llvm::ConstantExpr::getZExt(), isAggregateType(), isArrayTy(), isDerivedType(), isDoubleTy(), isFirstClassType(), isFloatingPointTy(), isFloatTy(), isFP128Ty(), isFunctionTy(), isHalfTy(), isIntegerTy(), isLabelTy(), isLeakCheckerRoot(), llvm::XCoreTargetLowering::isLegalAddressingMode(), isMetadataTy(), isPointerTy(), isPPC_FP128Ty(), isPrimitiveType(), isSingleValueType(), isSized(), isStructTy(), llvm::ConstantFP::isValueValidForType(), isVectorTy(), isVoidTy(), isX86_FP80Ty(), isX86_MMXTy(), llvm::ExecutionEngine::LoadValueFromMemory(), needsFPStubFromParams(), llvm::TypePrinting::print(), ReplaceFPIntrinsicWithCall(), llvm::Interpreter::run(), llvm::JIT::runFunction(), llvm::MCJIT::runFunction(), setTypeID(), llvm::ExecutionEngine::StoreValueToMemory(), llvm::Interpreter::visitExtractElementInst(), llvm::Interpreter::visitExtractValueInst(), llvm::Interpreter::visitInsertElementInst(), llvm::Interpreter::visitInsertValueInst(), llvm::Interpreter::visitShuffleVectorInst(), llvm::Interpreter::visitVAArgInst(), whichFPParamVariantNeeded(), whichFPReturnVariant(), and WriteTypeTable().

Type* llvm::Type::getVectorElementType ( ) const
inline
unsigned Type::getVectorNumElements ( ) const
Type * Type::getVoidTy ( LLVMContext C)
static
PointerType * Type::getX86_FP80PtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 260 of file Type.cpp.

References getPointerTo(), and getX86_FP80Ty().

Type * Type::getX86_FP80Ty ( LLVMContext C)
static
PointerType * Type::getX86_MMXPtrTy ( LLVMContext C,
unsigned  AS = 0 
)
static

Definition at line 272 of file Type.cpp.

References getPointerTo(), and getX86_MMXTy().

Type * Type::getX86_MMXTy ( LLVMContext C)
static
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 270 of file Type.h.

References ArrayTyID, getTypeID(), and StructTyID.

Referenced by advanceToNextLeafType(), llvm::CastInst::castIsValid(), firstRealType(), llvm::ExecutionEngine::getConstantValue(), llvm::NVPTXTargetLowering::getPrototype(), llvm::SelectionDAGBuilder::getValueImpl(), llvm::NVPTXTargetLowering::LowerCall(), and llvm::NVPTXTargetLowering::LowerFormalArguments().

bool llvm::Type::isArrayTy ( ) const
inline
bool llvm::Type::isDerivedType ( ) const
inline

Definition at line 246 of file Type.h.

References FirstDerivedTyID, and getTypeID().

bool llvm::Type::isDoubleTy ( ) const
inline
bool Type::isEmptyTy ( ) const
bool llvm::Type::isFirstClassType ( ) const
inline
bool llvm::Type::isFloatingPointTy ( ) const
inline
bool llvm::Type::isFloatTy ( ) const
inline
bool llvm::Type::isFP128Ty ( ) const
inline
bool llvm::Type::isFPOrFPVectorTy ( ) const
inline
bool llvm::Type::isFunctionTy ( ) const
inline

isFunctionTy - True if this is an instance of FunctionType.

Definition at line 208 of file Type.h.

References FunctionTyID, and getTypeID().

Referenced by llvm::StructType::isValidElementType(), llvm::ArrayType::isValidElementType(), and llvm::FunctionType::isValidReturnType().

bool Type::isFunctionVarArg ( ) const

Definition at line 182 of file Type.cpp.

bool llvm::Type::isHalfTy ( ) const
inline

isHalfTy - Return true if this is 'half', a 16-bit IEEE fp type.

Definition at line 143 of file Type.h.

References getTypeID(), and HalfTyID.

Referenced by ConstantFoldBinaryFP(), llvm::ConstantFoldCall(), llvm::ConstantFoldCastInstruction(), ConstantFoldFP(), TypeToFloatSemantics(), llvm::InstCombiner::visitFCmpInst(), and WriteConstants().

bool llvm::Type::isIntegerTy ( ) const
inline

isIntegerTy - True if this is an instance of IntegerType.

Definition at line 196 of file Type.h.

References getTypeID(), and IntegerTyID.

Referenced by llvm::HexagonTargetLowering::allowTruncateForTailCall(), llvm::ARMTargetLowering::allowTruncateForTailCall(), llvm::X86TargetLowering::allowTruncateForTailCall(), canConvertValue(), llvm::CastInst::castIsValid(), CoerceAvailableValueToLoadType(), llvm::InstCombiner::commonCastTransforms(), llvm::ComputeMaskedBits(), llvm::ComputeMultiple(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCompareInstruction(), ConstantFoldGetElementPtrImpl(), convertValue(), createCast(), dyn_castFoldableMul(), evaluateICmpRelation(), llvm::X86TargetLowering::ExpandInlineAsm(), ExtractConstantBytes(), FindCXAAtExit(), llvm::SimplifyFortifiedLibCalls::fold(), FoldBitCast(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), foldLogOpOfMaskedICmpsHelper(), foldSelectICmpAnd(), foldSelectICmpAndOr(), FoldTwoEntryPHINode(), getAdjustedPtr(), getAISize(), getAllocationData(), llvm::CastInst::getCastOpcode(), llvm::ExecutionEngine::getConstantValue(), llvm::ScalarEvolution::getEffectiveSCEVType(), llvm::ConstantExpr::getExtractElement(), getFalse(), llvm::ConstantInt::getFalse(), llvm::objcarc::GetFunctionClass(), llvm::ConstantExpr::getInsertElement(), llvm::ConstantExpr::getIntToPtr(), GetLinearExpression(), GetLoadValueForLoad(), getNaturalGEPWithOffset(), llvm::ScalarEvolution::getNoopOrAnyExtend(), llvm::ScalarEvolution::getNoopOrSignExtend(), llvm::ScalarEvolution::getNoopOrZeroExtend(), getOpenCLAlignment(), llvm::SCEVExpander::getOrInsertCanonicalInductionVariable(), llvm::NVPTXTargetLowering::getPrototype(), llvm::ConstantExpr::getPtrToInt(), llvm::SystemZTargetLowering::getSingleConstraintMatchWeight(), llvm::ARMTargetLowering::getSingleConstraintMatchWeight(), llvm::PPCTargetLowering::getSingleConstraintMatchWeight(), llvm::X86TargetLowering::getSingleConstraintMatchWeight(), llvm::TargetLowering::getSingleConstraintMatchWeight(), GetStoreValueForLoad(), llvm::ConstantInt::getTrue(), getTrue(), llvm::ScalarEvolution::getTruncateOrNoop(), llvm::ScalarEvolution::getTruncateOrSignExtend(), llvm::ScalarEvolution::getTruncateOrZeroExtend(), llvm::ScalarEvolution::getTypeSizeInBits(), getUnderlyingObjectFromInt(), IdxCompare(), llvm::CompositeType::indexValid(), InstCombineLoadCast(), InstCombineStoreToCast(), llvm::isBytewiseValue(), llvm::CastInst::isCastable(), llvm::CastInst::isEliminableCastPair(), llvm::CastInst::isIntegerCast(), isIntegerTy(), isIntOrIntVectorTy(), llvm::ScalarEvolution::isSCEVable(), llvm::ConstantDataSequential::isString(), llvm::MSP430TargetLowering::isTruncateFree(), llvm::SystemZTargetLowering::isTruncateFree(), llvm::X86TargetLowering::isTruncateFree(), llvm::VectorType::isValidElementType(), llvm::ExtractElementInst::isValidOperands(), llvm::InsertElementInst::isValidOperands(), llvm::ShuffleVectorInst::isValidOperands(), llvm::ConstantInt::isValueValidForType(), isVectorPromotionViableForSlice(), llvm::MSP430TargetLowering::isZExtFree(), llvm::X86TargetLowering::isZExtFree(), LowerBSWAP(), llvm::NVPTXTargetLowering::LowerCall(), LowerCTPOP(), llvm::NVPTXTargetLowering::LowerReturn(), llvm::IntrinsicLowering::LowerToByteSwap(), MatchSelectFromAndOr(), originalTypeIsF128(), llvm::SCEVExpander::replaceCongruentIVs(), llvm::JIT::runFunction(), llvm::MCJIT::runFunction(), llvm::ExecutionEngine::runFunctionAsMain(), SimplifyAddInst(), SimplifyDiv(), SimplifyICmpInst(), SimplifyMulInst(), SimplifyRem(), SimplifySubInst(), SymbolicallyEvaluateGEP(), llvm::AttributeFuncs::typeIncompatible(), llvm::UnrollRuntimeLoopProlog(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitAnd(), llvm::InstCombiner::visitFMul(), llvm::InstCombiner::visitICmpInst(), llvm::InstCombiner::visitMul(), llvm::InstCombiner::visitOr(), llvm::InstCombiner::visitPHINode(), llvm::InstCombiner::visitSDiv(), llvm::InstCombiner::visitSelectInst(), llvm::InstCombiner::visitSRem(), llvm::InstCombiner::visitSub(), llvm::InstCombiner::visitXor(), llvm::InstCombiner::visitZExt(), and width_descending().

bool Type::isIntegerTy ( unsigned  Bitwidth) const

isIntegerTy - Return true if this is an IntegerType of the given width.

isIntegerTy - Return true if this is an IntegerType of the specified width.

Definition at line 58 of file Type.cpp.

References getBitWidth(), and isIntegerTy().

bool llvm::Type::isIntOrIntVectorTy ( ) const
inline
bool llvm::Type::isLabelTy ( ) const
inline
bool llvm::Type::isMetadataTy ( ) const
inline

isMetadataTy - Return true if this is 'metadata'.

Definition at line 192 of file Type.h.

References getTypeID(), and MetadataTyID.

Referenced by llvm::StructType::isValidElementType(), llvm::ArrayType::isValidElementType(), llvm::PointerType::isValidElementType(), and llvm::FunctionType::isValidReturnType().

bool llvm::Type::isPointerTy ( ) const
inline

isPointerTy - True if this is an instance of PointerType.

Definition at line 220 of file Type.h.

References getTypeID(), and PointerTyID.

Referenced by BuildConstantFromSCEV(), canConvertValue(), canLosslesslyBitCastTo(), llvm::CastInst::castIsValid(), CoerceAvailableValueToLoadType(), llvm::ComputeMaskedBits(), ConstructSSAForLoadSet(), convertPointerToIntegerType(), convertValue(), createCast(), createFree(), llvm::EmitFPutC(), llvm::EmitFPutS(), llvm::EmitFWrite(), evaluateICmpRelation(), FindCXAAtExit(), FindLoopCounter(), llvm::SimplifyFortifiedLibCalls::fold(), FoldBitCast(), genLoopLimit(), getAdjustedPtr(), llvm::CastInst::getCastOpcode(), GetConstantInt(), llvm::ExecutionEngine::getConstantValue(), llvm::ScalarEvolution::getEffectiveSCEVType(), llvm::DataLayout::getIndexedOffset(), getIndexedTypeInternal(), llvm::ConstantExpr::getIntToPtr(), llvm::AliasAnalysis::getModRefInfo(), getNaturalGEPRecursively(), getNaturalGEPWithType(), llvm::MemoryDependenceAnalysis::getNonLocalPointerDependency(), llvm::ScalarEvolution::getNoopOrAnyExtend(), llvm::ScalarEvolution::getNoopOrSignExtend(), llvm::ScalarEvolution::getNoopOrZeroExtend(), llvm::getOrEnforceKnownAlignment(), llvm::ScalarEvolution::getPointerBase(), llvm::TargetLoweringBase::getPointerTypeSizeInBits(), llvm::DataLayout::getPointerTypeSizeInBits(), llvm::ConstantExpr::getPtrToInt(), llvm::SelectionDAG::getSrcValue(), GetStoreValueForLoad(), llvm::GetStringLength(), llvm::ScalarEvolution::getTruncateOrNoop(), llvm::ScalarEvolution::getTruncateOrSignExtend(), llvm::ScalarEvolution::getTruncateOrZeroExtend(), getTypeIDForHash(), llvm::ScalarEvolution::getTypeSizeInBits(), llvm::GetUnderlyingObject(), getUnderlyingObjects(), InstCombineLoadCast(), InstCombineStoreToCast(), llvm::MemoryDependenceAnalysis::invalidateCachedPointerInfo(), llvm::CastInst::isCastable(), isCompatibleIVType(), isGEPKnownNonNull(), isInterestingPointer(), llvm::isKnownNonZero(), llvm::CastInst::isLosslessCast(), isNoopBitcast(), isPtrOrPtrVectorTy(), llvm::ScalarEvolution::isSCEVable(), isStridedPtr(), llvm::VectorType::isValidElementType(), llvm::NVPTXTargetLowering::LowerCall(), OptimizeOnceStoredGlobal(), llvm::PointerMayBeCaptured(), promoteSingleBlockAlloca(), llvm::MemoryDependenceAnalysis::removeInstruction(), llvm::SCEVExpander::replaceCongruentIVs(), rewriteSingleStoreAlloca(), llvm::JIT::runFunction(), llvm::MCJIT::runFunction(), SimplifyBranchOnICmpChain(), SimplifyICmpInst(), llvm::Value::stripAndAccumulateInBoundsConstantOffsets(), stripAndComputeConstantOffsets(), StripPtrCastKeepAS(), swapMayExposeCSEOpportunities(), SymbolicallyEvaluateGEP(), TryToShrinkGlobalToBoolean(), llvm::AttributeFuncs::typeIncompatible(), llvm::InstCombiner::visitBitCast(), llvm::InstCombiner::visitICmpInst(), and llvm::PtrUseVisitor< SliceBuilder >::visitPtr().

bool llvm::Type::isPPC_FP128Ty ( ) const
inline

isPPC_FP128Ty - Return true if this is powerpc long double.

Definition at line 158 of file Type.h.

References getTypeID(), and PPC_FP128TyID.

Referenced by llvm::ConstantFoldCastInstruction(), emitGlobalConstantFP(), llvm::Constant::getAllOnesValue(), TypeToFloatSemantics(), llvm::InstCombiner::visitFCmpInst(), and WriteConstants().

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 245 of file Type.h.

References getTypeID(), and LastPrimitiveTyID.

Referenced by getOpenCLAlignment(), llvm::NVPTXTargetLowering::getPrototype(), isSingleValueType(), and llvm::NVPTXTargetLowering::LowerCall().

bool llvm::Type::isPtrOrPtrVectorTy ( ) const
inline
bool llvm::Type::isSingleValueType ( ) const
inline

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

Definition at line 259 of file Type.h.

References getTypeID(), IntegerTyID, isPrimitiveType(), PointerTyID, VectorTyID, and VoidTyID.

Referenced by canConvertValue(), llvm::TargetLowering::ParseConstraints(), reduceToSingleValueType(), and stripAggregateTypeWrapping().

bool llvm::Type::isSized ( ) const
inline
bool llvm::Type::isStructTy ( ) const
inline
bool llvm::Type::isVectorTy ( ) const
inline

isVectorTy - True if this is an instance of VectorType.

Definition at line 229 of file Type.h.

References getTypeID(), and VectorTyID.

Referenced by llvm::CastInst::castIsValid(), CollectShuffleElements(), llvm::ComputeMaskedBits(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldCompareInstruction(), convertValue(), llvm::CastInst::CreatePointerCast(), executeFCMP_BOOL(), executeFCMP_ONE(), executeFCMP_ORD(), executeFCMP_UNO(), executeSelectInst(), llvm::expandDivision(), llvm::expandDivisionUpTo32Bits(), llvm::expandRemainderUpTo32Bits(), FindLIVLoopCondition(), FindScalarElement(), foldLogOpOfMaskedICmpsHelper(), llvm::InstCombiner::FoldSelectOpOp(), llvm::ConstantAggregateZero::get(), llvm::CastInst::getCastOpcode(), llvm::ConstantExpr::getExtractElement(), llvm::GetElementPtrInst::getGEPReturnType(), llvm::ConstantExpr::getGetElementPtr(), llvm::ConstantExpr::getInsertElement(), llvm::GetPointerBaseWithConstantOffset(), llvm::NVPTXTargetLowering::getPrototype(), llvm::PPCTargetLowering::getSingleConstraintMatchWeight(), llvm::AArch64TargetLowering::getTgtMemIntrinsic(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), llvm::TargetLoweringBase::getValueType(), llvm::CompositeType::indexValid(), InstCombineLoadCast(), llvm::CastInst::isCastable(), llvm::CastInst::isEliminableCastPair(), llvm::ExtractElementInst::isValidOperands(), llvm::InsertElementInst::isValidOperands(), llvm::ShuffleVectorInst::isValidOperands(), llvm::NVPTXTargetLowering::LowerCall(), llvm::NVPTXTargetLowering::LowerFormalArguments(), matchPairwiseReductionAtLevel(), stripAndComputeConstantOffsets(), ThreadCmpOverSelect(), TryToShrinkGlobalToBoolean(), llvm::Interpreter::visitAShr(), llvm::Interpreter::visitBinaryOperator(), llvm::InstCombiner::visitBitCast(), llvm::InstCombiner::visitExtractElementInst(), llvm::Interpreter::visitInsertElementInst(), llvm::InstCombiner::visitIntToPtr(), llvm::Interpreter::visitLShr(), llvm::InstCombiner::visitMul(), llvm::InstCombiner::visitOr(), llvm::InstCombiner::visitPtrToInt(), llvm::Interpreter::visitShl(), llvm::Interpreter::visitShuffleVectorInst(), and llvm::InstCombiner::visitTrunc().

bool llvm::Type::isVoidTy ( ) const
inline
bool llvm::Type::isX86_FP80Ty ( ) const
inline

isX86_FP80Ty - Return true if this is x86 long double.

Definition at line 152 of file Type.h.

References getTypeID(), and X86_FP80TyID.

Referenced by llvm::ConstantFoldCastInstruction(), llvm::ExecutionEngine::getConstantValue(), TypeToFloatSemantics(), llvm::InstCombiner::visitFCmpInst(), and WriteConstants().

bool llvm::Type::isX86_MMXTy ( ) const
inline
void Type::print ( raw_ostream O) const
void llvm::Type::setSubclassData ( unsigned  val)
inlineprotected
void llvm::Type::setTypeID ( TypeID  ID)
inlineprotected

Definition at line 99 of file Type.h.

References getTypeID().

Referenced by Type().

subtype_iterator llvm::Type::subtype_begin ( ) const
inline
subtype_iterator llvm::Type::subtype_end ( ) const
inline
subtype_reverse_iterator llvm::Type::subtype_rbegin ( ) const
inline

Definition at line 328 of file Type.h.

References subtype_end().

subtype_reverse_iterator llvm::Type::subtype_rend ( ) const
inline

Definition at line 331 of file Type.h.

References subtype_begin().

Friends And Related Function Documentation

friend class LLVMContextImpl
friend

Definition at line 91 of file Type.h.

Member Data Documentation

Type* const* llvm::Type::ContainedTys
protected

ContainedTys - A pointer to the array of Types 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).

Definition at line 121 of file Type.h.

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

unsigned llvm::Type::NumContainedTys
protected

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