LLVM API Documentation
#include <Constants.h>
Public Member Functions | |
DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Constant) | |
Transparently provide more efficient getOperand methods. | |
StructType * | getType () const |
void | destroyConstant () override |
void | replaceUsesOfWithOnConstant (Value *From, Value *To, Use *U) override |
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. | |
static bool | classof (const Value *V) |
Methods for support type inquiry through isa, cast, and dyn_cast: | |
Protected Member Functions | |
ConstantStruct (StructType *T, ArrayRef< Constant * > Val) | |
Friends | |
struct | ConstantAggrKeyType< ConstantStruct > |
Definition at line 378 of file Constants.h.
ConstantStruct::ConstantStruct | ( | StructType * | T, |
ArrayRef< Constant * > | Val | ||
) | [protected] |
Definition at line 948 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().
static bool llvm::ConstantStruct::classof | ( | const Value * | V | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:
Reimplemented from llvm::Constant.
Definition at line 421 of file Constants.h.
References llvm::Value::getValueID().
Transparently provide more efficient getOperand methods.
void ConstantStruct::destroyConstant | ( | ) | [override, 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 1361 of file Constants.cpp.
References llvm::Constant::destroyConstantImpl(), llvm::Type::getContext(), getType(), llvm::LLVMContext::pImpl, llvm::ConstantUniqueMap< ConstantClass >::remove(), and llvm::LLVMContextImpl::StructConstants.
Constant * ConstantStruct::get | ( | StructType * | T, |
ArrayRef< Constant * > | V | ||
) | [static] |
Definition at line 961 of file Constants.cpp.
References llvm::ArrayRef< T >::empty(), llvm::Type::getContext(), llvm::StructType::getNumElements(), llvm::ConstantUniqueMap< ConstantClass >::getOrCreate(), llvm::Constant::isNullValue(), llvm::StructType::isOpaque(), isZero(), llvm::LLVMContext::pImpl, llvm::ArrayRef< T >::size(), and llvm::LLVMContextImpl::StructConstants.
Referenced by appendToGlobalArray(), llvm::ConstantFoldInsertValueInstruction(), ConstantFoldScalarCall(), EvaluateStoreInto(), getTypeForElements(), INITIALIZE_TM_PASS(), LLVMConstNamedStruct(), llvm::MapValue(), llvm::BitcodeReaderValueList::ResolveConstantForwardRefs(), upgradeGlobalArray(), and llvm::InstCombiner::visitCallInst().
Constant * ConstantStruct::get | ( | StructType * | T, |
... | |||
) | [static] |
Definition at line 989 of file Constants.cpp.
References llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and T.
static Constant* llvm::ConstantStruct::getAnon | ( | ArrayRef< Constant * > | V, |
bool | Packed = false |
||
) | [inline, static] |
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 createPrivateGlobalForSourceLoc(), and LLVMConstStructInContext().
static Constant* llvm::ConstantStruct::getAnon | ( | LLVMContext & | Ctx, |
ArrayRef< Constant * > | V, | ||
bool | Packed = false |
||
) | [inline, static] |
Definition at line 394 of file Constants.h.
StructType* llvm::ConstantStruct::getType | ( | ) | const [inline] |
getType() specialization - Reduce amount of casting...
Reimplemented from llvm::Value.
Definition at line 413 of file Constants.h.
References llvm::Value::getType().
Referenced by destroyConstant(), emitGlobalConstantStruct(), getTypeForElements(), and replaceUsesOfWithOnConstant().
StructType * ConstantStruct::getTypeForElements | ( | ArrayRef< Constant * > | V, |
bool | Packed = false |
||
) | [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 940 of file Constants.cpp.
References llvm::ArrayRef< T >::empty(), and llvm::Value::getContext().
StructType * ConstantStruct::getTypeForElements | ( | LLVMContext & | Context, |
ArrayRef< Constant * > | V, | ||
bool | Packed = false |
||
) | [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 928 of file Constants.cpp.
References get(), getType(), and llvm::ArrayRef< T >::size().
void ConstantStruct::replaceUsesOfWithOnConstant | ( | Value * | , |
Value * | , | ||
Use * | |||
) | [override, virtual] |
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 2799 of file Constants.cpp.
References llvm::ConstantAggregateZero::get(), llvm::UndefValue::get(), llvm::Value::getContext(), llvm::User::getNumOperands(), llvm::User::getOperand(), getType(), isAllZeros(), llvm::Constant::isNullValue(), llvm::User::OperandList, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::Constant::replaceUsesOfWithOnConstantImpl(), and llvm::SmallVectorImpl< T >::reserve().
friend struct ConstantAggrKeyType< ConstantStruct > [friend] |
Definition at line 379 of file Constants.h.