LLVM API Documentation
#include <Constants.h>
Public Member Functions | |
| DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Constant) | |
| Transparently provide more efficient getOperand methods. | |
| const StructType * | getType () const |
| virtual bool | isNullValue () const |
| virtual void | destroyConstant () |
| virtual void | replaceUsesOfWithOnConstant (Value *From, Value *To, Use *U) |
Static Public Member Functions | |
| static Constant * | get (const StructType *T, const std::vector< Constant * > &V) |
| static Constant * | get (LLVMContext &Context, const std::vector< Constant * > &V, bool Packed=false) |
| static Constant * | get (LLVMContext &Context, Constant *const *Vals, unsigned NumVals, bool Packed=false) |
| static bool | classof (const ConstantStruct *) |
| Methods for support type inquiry through isa, cast, and dyn_cast:. | |
| static bool | classof (const Value *V) |
Protected Member Functions | |
| ConstantStruct (const StructType *T, const std::vector< Constant * > &Val) | |
Friends | |
| struct | ConstantCreator< ConstantStruct, StructType, std::vector< Constant * > > |
Definition at line 408 of file Constants.h.
| ConstantStruct::ConstantStruct | ( | const StructType * | T, | |
| const std::vector< Constant * > & | Val | |||
| ) | [protected] |
Definition at line 524 of file Constants.cpp.
References llvm::CallingConv::C, E, llvm::StructType::getElementType(), llvm::StructType::getNumElements(), llvm::Value::getType(), getTypeID(), llvm::Type::getTypeID(), llvm::Type::isAbstract(), and llvm::User::OperandList.
| Constant * ConstantStruct::get | ( | const StructType * | T, | |
| const std::vector< Constant * > & | V | |||
| ) | [static] |
Definition at line 546 of file Constants.cpp.
References llvm::ConstantAggregateZero::get(), llvm::Type::getContext(), isNullValue(), llvm::LLVMContext::pImpl, and llvm::LLVMContextImpl::StructConstants.
Referenced by llvm::ConstantFoldInsertValueInstruction(), llvm::ConvertConstant< ConstantStruct, StructType >::convert(), llvm::DIFactory::CreateBasicType(), llvm::DIFactory::CreateBlock(), llvm::DIFactory::CreateCompileUnit(), llvm::DIFactory::CreateCompositeType(), llvm::DIFactory::CreateDerivedType(), llvm::DIFactory::CreateEnumerator(), llvm::DIFactory::CreateGlobalVariable(), llvm::DIFactory::CreateSubprogram(), llvm::DIFactory::CreateVariable(), llvm::DIFactory::GetOrCreateSubrange(), llvm::MapValue(), and llvm::BitcodeReaderValueList::ResolveConstantForwardRefs().
| Constant * ConstantStruct::get | ( | LLVMContext & | Context, | |
| const std::vector< Constant * > & | V, | |||
| bool | Packed = false | |||
| ) | [static] |
| Constant * ConstantStruct::get | ( | LLVMContext & | Context, | |
| Constant *const * | Vals, | |||
| unsigned | NumVals, | |||
| bool | Packed = false | |||
| ) | [static] |
Definition at line 568 of file Constants.cpp.
| llvm::ConstantStruct::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Constant | ) |
Transparently provide more efficient getOperand methods.
| const StructType* llvm::ConstantStruct::getType | ( | ) | const [inline] |
getType() specialization - Reduce amount of casting...
Reimplemented from llvm::Value.
Definition at line 428 of file Constants.h.
References llvm::Intrinsic::getType().
Referenced by destroyConstant(), and replaceUsesOfWithOnConstant().
| virtual bool llvm::ConstantStruct::isNullValue | ( | ) | const [inline, virtual] |
isNullValue - Return true if this is the value that would be returned by getNullValue. This always returns false because zero structs are always created as ConstantAggregateZero objects.
Implements llvm::Constant.
Definition at line 435 of file Constants.h.
Referenced by get().
| 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 941 of file Constants.cpp.
References llvm::Constant::destroyConstantImpl(), llvm::Type::getContext(), getType(), llvm::LLVMContext::pImpl, and llvm::LLVMContextImpl::StructConstants.
Referenced by llvm::ConvertConstant< ConstantStruct, StructType >::convert(), and replaceUsesOfWithOnConstant().
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 1923 of file Constants.cpp.
References llvm::LLVMContextImpl::ConstantsLock, Context, destroyConstant(), E, llvm::ConstantAggregateZero::get(), llvm::Type::getContext(), llvm::User::getNumOperands(), llvm::Constant::getOperand(), getType(), llvm::Constant::isNullValue(), Lookup(), llvm::SystemZCC::O, llvm::User::OperandList, llvm::LLVMContext::pImpl, llvm::Constant::setOperand(), llvm::LLVMContextImpl::StructConstants, llvm::Value::uncheckedReplaceAllUsesWith(), Val, and Values.
| static bool llvm::ConstantStruct::classof | ( | const ConstantStruct * | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:.
Definition at line 443 of file Constants.h.
Reimplemented from llvm::Constant.
Definition at line 444 of file Constants.h.
References llvm::Value::getValueID().
friend struct ConstantCreator< ConstantStruct, StructType,std::vector< Constant * > > [friend] |
Definition at line 410 of file Constants.h.