LLVM API Documentation
#include <Constants.h>


Public Member Functions | |
| DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Constant) | |
| Transparently provide more efficient getOperand methods. | |
| StructType * | getType () const |
| virtual void | destroyConstant () |
| virtual void | replaceUsesOfWithOnConstant (Value *From, Value *To, Use *U) |
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 | ConstantArrayCreator< ConstantStruct, StructType > |
Definition at line 380 of file Constants.h.
| ConstantStruct::ConstantStruct | ( | StructType * | T, |
| ArrayRef< Constant * > | Val | ||
| ) | [protected] |
Definition at line 863 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:
Reimplemented from llvm::Constant.
Definition at line 423 of file Constants.h.
References llvm::Value::getValueID().
| llvm::ConstantStruct::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Constant | ) |
Transparently provide more efficient getOperand methods.
| void ConstantStruct::destroyConstant | ( | ) | [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 1263 of file Constants.cpp.
References llvm::Constant::destroyConstantImpl(), llvm::Type::getContext(), getType(), llvm::LLVMContext::pImpl, and llvm::LLVMContextImpl::StructConstants.
Referenced by replaceUsesOfWithOnConstant().
| Constant * ConstantStruct::get | ( | StructType * | T, |
| ArrayRef< Constant * > | V | ||
| ) | [static] |
Definition at line 876 of file Constants.cpp.
References llvm::ArrayRef< T >::empty(), llvm::Type::getContext(), llvm::StructType::getNumElements(), 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(), getTypeForElements(), INITIALIZE_PASS(), InstallGlobalCtors(), LLVMConstNamedStruct(), llvm::MapValue(), replaceUsesOfWithOnConstant(), llvm::BitcodeReaderValueList::ResolveConstantForwardRefs(), and llvm::InstCombiner::visitCallInst().
| Constant * ConstantStruct::get | ( | StructType * | T, |
| ... | |||
| ) | [static] |
Definition at line 904 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 393 of file Constants.h.
Referenced by LLVMConstStructInContext().
| static Constant* llvm::ConstantStruct::getAnon | ( | LLVMContext & | Ctx, |
| ArrayRef< Constant * > | V, | ||
| bool | Packed = false |
||
| ) | [inline, static] |
Definition at line 396 of file Constants.h.
| StructType* llvm::ConstantStruct::getType | ( | ) | const [inline] |
getType() specialization - Reduce amount of casting...
Reimplemented from llvm::Value.
Definition at line 415 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 855 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 843 of file Constants.cpp.
References 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 2610 of file Constants.cpp.
References destroyConstant(), get(), llvm::Value::getContext(), llvm::User::getNumOperands(), llvm::User::getOperand(), getType(), I, isAllZeros(), llvm::Constant::isNullValue(), Lookup(), llvm::makeArrayRef(), llvm::User::OperandList, llvm::LLVMContext::pImpl, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::Value::replaceAllUsesWith(), llvm::SmallVectorImpl< T >::reserve(), llvm::User::setOperand(), and llvm::LLVMContextImpl::StructConstants.
friend struct ConstantArrayCreator< ConstantStruct, StructType > [friend] |
Definition at line 381 of file Constants.h.