LLVM API Documentation
#include <Constants.h>
Public Member Functions | |
DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Constant) | |
Transparently provide more efficient getOperand methods. More... | |
StructType * | getType () const |
virtual void | destroyConstant () |
virtual void | replaceUsesOfWithOnConstant (Value *From, Value *To, Use *U) |
![]() | |
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 |
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 (StructType *T, ArrayRef< Constant * > V) |
static Constant * | get (StructType *T,...) END_WITH_NULL |
static Constant * | getAnon (ArrayRef< Constant * > V, bool Packed=false) |
static Constant * | getAnon (LLVMContext &Ctx, ArrayRef< Constant * > V, bool Packed=false) |
static StructType * | getTypeForElements (ArrayRef< Constant * > V, bool Packed=false) |
static StructType * | getTypeForElements (LLVMContext &Ctx, ArrayRef< Constant * > V, bool Packed=false) |
getTypeForElements - This version of the method allows an empty list. More... | |
static bool | classof (const Value *V) |
Methods for support type inquiry through isa, cast, and dyn_cast: More... | |
![]() | |
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 | |
ConstantStruct (StructType *T, ArrayRef< Constant * > Val) | |
![]() | |
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 | |
struct | ConstantArrayCreator< ConstantStruct, StructType > |
Definition at line 378 of file Constants.h.
|
protected |
Definition at line 861 of file Constants.cpp.
References llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), llvm::StructType::getElementType(), llvm::StructType::getNumElements(), llvm::StructType::isOpaque(), llvm::User::op_begin(), and llvm::ArrayRef< T >::size().
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition at line 421 of file Constants.h.
References llvm::Value::getValueID().
llvm::ConstantStruct::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Constant | ) |
Transparently provide more efficient getOperand methods.
|
virtual |
destroyConstant - Called if some element of this constant is no longer valid. At this point only other constants may be on the use_list for this constant. Any constants on our Use list must also be destroy'd. The implementation must be sure to remove the constant from the list of available cached constants. Implementations should call destroyConstantImpl as the last thing they do, to destroy all users and delete this.
Reimplemented from llvm::Constant.
Definition at line 1262 of file Constants.cpp.
References llvm::Constant::destroyConstantImpl(), llvm::Type::getContext(), getType(), llvm::LLVMContext::pImpl, llvm::ConstantAggrUniqueMap< TypeClass, ConstantClass >::remove(), and llvm::LLVMContextImpl::StructConstants.
Referenced by replaceUsesOfWithOnConstant().
|
static |
Definition at line 874 of file Constants.cpp.
References llvm::ArrayRef< T >::empty(), llvm::ConstantAggregateZero::get(), llvm::UndefValue::get(), llvm::Type::getContext(), llvm::StructType::getNumElements(), llvm::ConstantAggrUniqueMap< TypeClass, ConstantClass >::getOrCreate(), llvm::Constant::isNullValue(), llvm::StructType::isOpaque(), isZero(), llvm::LLVMContext::pImpl, llvm::ArrayRef< T >::size(), and llvm::LLVMContextImpl::StructConstants.
Referenced by appendToGlobalArray(), llvm::ConstantFoldCall(), llvm::ConstantFoldInsertValueInstruction(), EvaluateStoreInto(), for(), InstallGlobalCtors(), LLVMConstNamedStruct(), llvm::MapValue(), llvm::BitcodeReaderValueList::ResolveConstantForwardRefs(), and llvm::InstCombiner::visitCallInst().
|
static |
Definition at line 902 of file Constants.cpp.
References llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and T.
|
inlinestatic |
getAnon - Return an anonymous struct that has the specified elements. If the struct is possibly empty, then you must specify a context.
Definition at line 391 of file Constants.h.
Referenced by LLVMConstStructInContext().
|
inlinestatic |
Definition at line 394 of file Constants.h.
|
inline |
getType() specialization - Reduce amount of casting...
Definition at line 413 of file Constants.h.
References llvm::Value::getType().
Referenced by destroyConstant(), emitGlobalConstantStruct(), getTypeForElements(), and replaceUsesOfWithOnConstant().
|
static |
getTypeForElements - Return an anonymous struct type to use for a constant with the specified set of elements. The list must not be empty.
Definition at line 853 of file Constants.cpp.
References llvm::ArrayRef< T >::empty(), and llvm::Value::getContext().
|
static |
getTypeForElements - This version of the method allows an empty list.
getTypeForElements - Return an anonymous struct type to use for a constant with the specified set of elements. The list must not be empty.
Definition at line 841 of file Constants.cpp.
References llvm::StructType::get(), getType(), and llvm::ArrayRef< T >::size().
replaceUsesOfWithOnConstant - This method is a special form of User::replaceUsesOfWith (which does not work on constants) that does work on constants. Basically this method goes through the trouble of building a new constant that is equivalent to the current one, with all uses of From replaced with uses of To. After this construction is completed, all of the users of 'this' are replaced to use the new constant, and then 'this' is deleted. In general, you should not call this method, instead, use Value::replaceAllUsesWith, which automatically dispatches to this method as needed.
Reimplemented from llvm::Constant.
Definition at line 2635 of file Constants.cpp.
References destroyConstant(), llvm::ConstantAggrUniqueMap< TypeClass, ConstantClass >::find(), llvm::ConstantAggregateZero::get(), llvm::UndefValue::get(), llvm::Value::getContext(), llvm::User::getNumOperands(), llvm::User::getOperand(), getType(), I, llvm::ConstantAggrUniqueMap< TypeClass, ConstantClass >::insert(), isAllZeros(), llvm::Constant::isNullValue(), Lookup(), llvm::makeArrayRef(), llvm::ConstantAggrUniqueMap< TypeClass, ConstantClass >::map_end(), llvm::User::OperandList, llvm::LLVMContext::pImpl, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::ConstantAggrUniqueMap< TypeClass, ConstantClass >::remove(), llvm::Value::replaceAllUsesWith(), llvm::SmallVectorImpl< T >::reserve(), llvm::User::setOperand(), and llvm::LLVMContextImpl::StructConstants.
|
friend |
Definition at line 379 of file Constants.h.