LLVM API Documentation
#include <Constants.h>
Public Member Functions | |
ArrayType * | getType () const |
![]() | |
uint64_t | getElementAsInteger (unsigned i) const |
APFloat | getElementAsAPFloat (unsigned i) const |
float | getElementAsFloat (unsigned i) const |
double | getElementAsDouble (unsigned i) const |
Constant * | getElementAsConstant (unsigned i) const |
SequentialType * | getType () const |
Type * | getElementType () const |
getElementType - Return the element type of the array/vector. More... | |
unsigned | getNumElements () const |
getNumElements - Return the number of elements in the array or vector. More... | |
uint64_t | getElementByteSize () const |
getElementByteSize - Return the size in bytes of the elements in the data. More... | |
bool | isString () const |
isString - This method returns true if this is an array of i8. More... | |
bool | isCString () const |
StringRef | getAsString () const |
StringRef | getAsCString () const |
StringRef | getRawDataValues () const |
virtual void | destroyConstant () |
![]() | |
bool | isNullValue () const |
bool | isAllOnesValue () const |
bool | isNegativeZeroValue () const |
bool | isZeroValue () const |
Return true if the value is negative zero or null value. More... | |
bool | canTrap () const |
bool | isThreadDependent () const |
isThreadDependent - Return true if the value can vary between threads. More... | |
bool | isConstantUsed () const |
PossibleRelocationsTy | getRelocationInfo () const |
Constant * | getAggregateElement (unsigned Elt) const |
Constant * | getAggregateElement (Constant *Elt) const |
Constant * | getSplatValue () const |
const APInt & | getUniqueInteger () const |
virtual void | replaceUsesOfWithOnConstant (Value *, Value *, Use *) |
void | removeDeadConstantUsers () const |
![]() | |
~User () | |
void | operator delete (void *Usr) |
operator delete - free memory allocated for User and Use objects More... | |
void | operator delete (void *, unsigned) |
placement delete - required by std, but never called. More... | |
void | operator delete (void *, unsigned, bool) |
placement delete - required by std, but never called. More... | |
Value * | getOperand (unsigned i) const |
void | setOperand (unsigned i, Value *Val) |
const Use & | getOperandUse (unsigned i) const |
Use & | getOperandUse (unsigned i) |
unsigned | getNumOperands () const |
op_iterator | op_begin () |
const_op_iterator | op_begin () const |
op_iterator | op_end () |
const_op_iterator | op_end () const |
value_op_iterator | value_op_begin () |
value_op_iterator | value_op_end () |
void | dropAllReferences () |
void | replaceUsesOfWith (Value *From, Value *To) |
![]() | |
virtual | ~Value () |
void | dump () const |
dump - Support for debugging, callable in GDB: V->dump() More... | |
void | print (raw_ostream &O, AssemblyAnnotationWriter *AAW=0) const |
Type * | getType () const |
LLVMContext & | getContext () const |
All values hold a context through their type. More... | |
bool | hasName () const |
ValueName * | getValueName () 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 |
User * | use_back () |
const User * | use_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 |
Value * | stripPointerCasts () |
Strips off any unneeded pointer casts, all-zero GEPs and aliases from the specified value, returning the original uncasted value. More... | |
const Value * | stripPointerCasts () const |
Value * | stripPointerCastsNoFollowAliases () |
Strips off any unneeded pointer casts and all-zero GEPs from the specified value, returning the original uncasted value. More... | |
const Value * | stripPointerCastsNoFollowAliases () const |
Value * | stripInBoundsConstantOffsets () |
Strips off unneeded pointer casts and all-constant GEPs from the specified value, returning the original pointer value. More... | |
const Value * | stripInBoundsConstantOffsets () const |
Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) |
Strips like stripInBoundsConstantOffsets but also accumulates the constant offset stripped. More... | |
const Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const |
Value * | stripInBoundsOffsets () |
Strips off unneeded pointer casts and any in-bounds offsets from the specified value, returning the original pointer value. More... | |
const Value * | stripInBoundsOffsets () const |
bool | isDereferenceablePointer () const |
Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) |
const Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const |
void | mutateType (Type *Ty) |
Static Public Member Functions | |
static Constant * | get (LLVMContext &Context, ArrayRef< uint8_t > Elts) |
static Constant * | get (LLVMContext &Context, ArrayRef< uint16_t > Elts) |
static Constant * | get (LLVMContext &Context, ArrayRef< uint32_t > Elts) |
static Constant * | get (LLVMContext &Context, ArrayRef< uint64_t > Elts) |
static Constant * | get (LLVMContext &Context, ArrayRef< float > Elts) |
static Constant * | get (LLVMContext &Context, ArrayRef< double > Elts) |
static Constant * | getString (LLVMContext &Context, StringRef Initializer, bool AddNull=true) |
static bool | classof (const Value *V) |
![]() | |
static bool | isElementTypeCompatible (const Type *Ty) |
static bool | classof (const Value *V) |
![]() | |
static bool | classof (const Value *V) |
static Constant * | getNullValue (Type *Ty) |
static Constant * | getAllOnesValue (Type *Ty) |
Get the all ones value. More... | |
static Constant * | getIntegerValue (Type *Ty, const APInt &V) |
![]() | |
static bool | classof (const Value *V) |
Protected Member Functions | |
void * | operator new (size_t s) |
![]() | |
ConstantDataSequential (Type *ty, ValueTy VT, const char *Data) | |
~ConstantDataSequential () | |
void * | operator new (size_t s) |
![]() | |
Constant (Type *ty, ValueTy vty, Use *Ops, unsigned NumOps) | |
void | destroyConstantImpl () |
![]() | |
void * | operator new (size_t s, unsigned Us) |
User (Type *ty, unsigned vty, Use *OpList, unsigned NumOps) | |
Use * | allocHungoffUses (unsigned) const |
void | dropHungoffUses () |
template<int Idx> | |
Use & | Op () |
template<int Idx> | |
const Use & | Op () const |
![]() | |
virtual void | printCustom (raw_ostream &O) const |
Value (Type *Ty, unsigned scid) | |
unsigned short | getSubclassDataFromValue () const |
void | setValueSubclassData (unsigned short D) |
Friends | |
class | ConstantDataSequential |
ConstantDataArray - An array constant whose element type is a simple 1/2/4/8-byte integer or float/double, and whose elements are just simple data values (i.e. ConstantInt/ConstantFP). This Constant node has no operands because it stores all of the elements of the constant as densely packed data, instead of as Value*'s.
Definition at line 645 of file Constants.h.
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition at line 686 of file Constants.h.
References llvm::Value::ConstantDataArrayVal, and llvm::Value::getValueID().
|
static |
get() constructors - Return a constant with array type with an element count and element type matching the ArrayRef passed in. Note that this can return a ConstantAggregateZero object.
Definition at line 2321 of file Constants.cpp.
References llvm::ArrayRef< T >::data(), llvm::ArrayType::get(), llvm::ConstantDataSequential::getImpl(), llvm::Type::getInt8Ty(), and llvm::ArrayRef< T >::size().
Referenced by llvm::ConstantArray::get().
|
static |
Definition at line 2326 of file Constants.cpp.
References llvm::ArrayRef< T >::data(), llvm::ArrayType::get(), llvm::ConstantDataSequential::getImpl(), llvm::Type::getInt16Ty(), and llvm::ArrayRef< T >::size().
|
static |
Definition at line 2331 of file Constants.cpp.
References llvm::ArrayRef< T >::data(), llvm::ArrayType::get(), llvm::ConstantDataSequential::getImpl(), llvm::Type::getInt32Ty(), and llvm::ArrayRef< T >::size().
|
static |
Definition at line 2336 of file Constants.cpp.
References llvm::ArrayRef< T >::data(), llvm::ArrayType::get(), llvm::ConstantDataSequential::getImpl(), llvm::Type::getInt64Ty(), and llvm::ArrayRef< T >::size().
|
static |
Definition at line 2341 of file Constants.cpp.
References llvm::ArrayRef< T >::data(), llvm::ArrayType::get(), llvm::Type::getFloatTy(), llvm::ConstantDataSequential::getImpl(), and llvm::ArrayRef< T >::size().
|
static |
Definition at line 2346 of file Constants.cpp.
References llvm::ArrayRef< T >::data(), llvm::ArrayType::get(), llvm::Type::getDoubleTy(), llvm::ConstantDataSequential::getImpl(), and llvm::ArrayRef< T >::size().
|
static |
getString - This method constructs a CDS and initializes it with a text string. The default behavior (AddNull==true) causes a null terminator to be placed at the end of the array (increasing the length of the string by one more than the StringRef would normally indicate. Pass AddNull=false to disable this behavior.
Definition at line 2357 of file Constants.cpp.
References llvm::SmallVectorImpl< T >::append(), llvm::StringRef::begin(), llvm::StringRef::data(), llvm::StringRef::end(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::StringRef::size().
Referenced by llvm::IRBuilderBase::CreateGlobalString(), createPrivateGlobalForString(), createPrivateNonConstGlobalForString(), and LLVMConstStringInContext().
|
inline |
getType - Specialize the getType() method to always return an ArrayType, which reduces the amount of casting needed in parts of the compiler.
Definition at line 680 of file Constants.h.
References llvm::Value::getType().
Referenced by llvm::getConstantStringInfo().
|
inlineprotected |
Definition at line 654 of file Constants.h.
|
friend |
Definition at line 649 of file Constants.h.