LLVM API Documentation
#include <DerivedTypes.h>


Public Types | |
| enum | { MIN_INT_BITS = 1, MAX_INT_BITS = (1<<23)-1 } |
| This enum is just used to hold constants we need for IntegerType. More... | |
Public Member Functions | |
| unsigned | getBitWidth () const |
| Get the number of bits in this IntegerType. | |
| uint64_t | getBitMask () const |
| uint64_t | getSignBit () const |
| APInt | getMask () const |
| Get a bit mask for this type. | |
| bool | isPowerOf2ByteWidth () const |
| Is this a power-of-2 byte-width IntegerType ? | |
Static Public Member Functions | |
| static const IntegerType * | get (unsigned NumBits) |
| Get or create an IntegerType instance. | |
| static bool | classof (const IntegerType *) |
| static bool | classof (const Type *T) |
| Methods for support type inquiry through isa, cast, and dyn_cast:. | |
Protected Member Functions | |
| IntegerType (unsigned NumBits) | |
Friends | |
| class | TypeMap< IntegerValType, IntegerType > |
Class to represent integer types. Note that this class is also used to represent the built-in integer types: Int1Ty, Int8Ty, Int16Ty, Int32Ty and Int64Ty.
Definition at line 80 of file DerivedTypes.h.
| anonymous enum |
This enum is just used to hold constants we need for IntegerType.
| MIN_INT_BITS | Minimum number of bits that can be specified. |
| MAX_INT_BITS | Maximum number of bits that can be specified Note that bit width is stored in the Type classes SubclassData field which has 23 bits. This yields a maximum bit width of 8,388,607 bits. |
Definition at line 88 of file DerivedTypes.h.
| llvm::IntegerType::IntegerType | ( | unsigned | NumBits | ) | [inline, explicit, protected] |
Definition at line 82 of file DerivedTypes.h.
References llvm::Type::setSubclassData().
Referenced by get().
| const IntegerType * IntegerType::get | ( | unsigned | NumBits | ) | [static] |
Get or create an IntegerType instance.
This static method is the primary way of constructing an IntegerType. If an IntegerType with the same NumBits value was previously instantiated, that instance will be returned. Otherwise a new one will be created. Only one instance with a given NumBits value is ever created.
Definition at line 1022 of file Type.cpp.
References DOUT, IntegerType(), MAX_INT_BITS, and MIN_INT_BITS.
Referenced by BinomialCoefficient(), llvm::ConstantFoldCompareInstruction(), llvm::ConstantInt::get(), llvm::SDISelAsmOperandInfo::getCallOperandValMVT(), llvm::VectorType::getExtendedElementVectorType(), llvm::VectorType::getInteger(), llvm::TargetData::getIntPtrType(), llvm::VectorType::getTruncatedElementVectorType(), llvm::MVT::getTypeForMVT(), and llvm::ConstantExpr::getVFCmp().
| unsigned llvm::IntegerType::getBitWidth | ( | ) | const [inline] |
Get the number of bits in this IntegerType.
Definition at line 103 of file DerivedTypes.h.
References llvm::Type::getSubclassData().
Referenced by BinomialCoefficient(), llvm::ComputeMaskedBits(), llvm::ComputeNumSignBits(), llvm::ConstantFoldBinaryInstruction(), llvm::DebugInfoBuilder::createCharacterTypeDescriptor(), llvm::DebugInfoBuilder::createIntegerTypeDescriptor(), doSignExtension(), llvm::ConstantInt::get(), getBitMask(), getMask(), getSignBit(), getTypeDescription(), llvm::IntegerValType::hashTypeStructure(), isPowerOf2ByteWidth(), isRunOfOnes(), LowerPartSet(), and TypesEqual().
| uint64_t llvm::IntegerType::getBitMask | ( | ) | const [inline] |
getBitMask - Return a bitmask with ones set for all of the bits that can be set by an unsigned version of this type. This is 0xFF for i8, 0xFFFF for i16, etc.
Definition at line 108 of file DerivedTypes.h.
References getBitWidth().
Referenced by doSignExtension().
| uint64_t llvm::IntegerType::getSignBit | ( | ) | const [inline] |
getSignBit - Return a uint64_t with just the most significant bit set (the sign bit, if the value is treated as a signed number).
Definition at line 114 of file DerivedTypes.h.
References getBitWidth().
| APInt IntegerType::getMask | ( | ) | const |
Get a bit mask for this type.
For example, this is 0xFF for an 8 bit integer, 0xFFFF for i16, etc.
Definition at line 1056 of file Type.cpp.
References llvm::APInt::getAllOnesValue(), and getBitWidth().
| bool IntegerType::isPowerOf2ByteWidth | ( | ) | const |
Is this a power-of-2 byte-width IntegerType ?
This method determines if the width of this IntegerType is a power-of-2 in terms of 8 bit bytes.
Definition at line 1051 of file Type.cpp.
References getBitWidth(), and llvm::isPowerOf2_32().
| static bool llvm::IntegerType::classof | ( | const IntegerType * | ) | [inline, static] |
Definition at line 130 of file DerivedTypes.h.
| static bool llvm::IntegerType::classof | ( | const Type * | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:.
Reimplemented from llvm::DerivedType.
Definition at line 131 of file DerivedTypes.h.
References llvm::Type::getTypeID(), and llvm::Type::IntegerTyID.
friend class TypeMap< IntegerValType, IntegerType > [friend] |
Definition at line 85 of file DerivedTypes.h.
This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.