LLVM API Documentation
#include <Constants.h>


Public Member Functions | |
| DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Constant) | |
| Transparently provide more efficient getOperand methods. | |
| VectorType * | getType () const |
| Constant * | getSplatValue () const |
| virtual void | destroyConstant () |
| virtual void | replaceUsesOfWithOnConstant (Value *From, Value *To, Use *U) |
Static Public Member Functions | |
| static Constant * | get (ArrayRef< Constant * > V) |
| static Constant * | getSplat (unsigned NumElts, Constant *Elt) |
| static bool | classof (const Value *V) |
| Methods for support type inquiry through isa, cast, and dyn_cast: | |
Protected Member Functions | |
| ConstantVector (VectorType *T, ArrayRef< Constant * > Val) | |
Friends | |
| struct | ConstantArrayCreator< ConstantVector, VectorType > |
ConstantVector - Constant Vector Declarations
Definition at line 437 of file Constants.h.
| ConstantVector::ConstantVector | ( | VectorType * | T, |
| ArrayRef< Constant * > | Val | ||
| ) | [protected] |
Definition at line 912 of file Constants.cpp.
References llvm::ArrayRef< T >::begin(), llvm::ArrayRef< T >::end(), llvm::SequentialType::getElementType(), getType(), 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 468 of file Constants.h.
References llvm::Value::getValueID().
| llvm::ConstantVector::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Constant | ) |
Transparently provide more efficient getOperand methods.
| void ConstantVector::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 1268 of file Constants.cpp.
References llvm::Constant::destroyConstantImpl(), llvm::Type::getContext(), getType(), llvm::LLVMContext::pImpl, and llvm::LLVMContextImpl::VectorConstants.
Referenced by replaceUsesOfWithOnConstant().
Definition at line 923 of file Constants.cpp.
References llvm::CallingConv::C, llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::front(), llvm::ConstantDataVector::get(), llvm::Value::getContext(), llvm::Value::getType(), llvm::ConstantDataSequential::isElementTypeCompatible(), llvm::Constant::isNullValue(), isZero(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::ArrayRef< T >::size(), llvm::SmallVectorTemplateCommon< T >::size(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by BitCastConstantVector(), llvm::X86TargetLowering::BuildFILD(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldCompareInstruction(), llvm::ConstantFoldInsertElementInstruction(), llvm::ConstantFoldInsertValueInstruction(), llvm::ConstantFoldSelectInstruction(), llvm::ConstantFoldShuffleVectorInstruction(), EvaluateStoreInto(), extractVector(), FoldBitCast(), getLogBase2Vector(), insertVector(), llvm::IntegersSubset::IntegersSubset(), LLVMConstVector(), llvm::MapValue(), llvm::BitcodeReaderValueList::ResolveConstantForwardRefs(), llvm::UpgradeIntrinsicCall(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitInsertElementInst(), llvm::InstCombiner::visitShuffleVectorInst(), and llvm::InstCombiner::visitSRem().
getSplat - Return a ConstantVector with the specified constant in each element.
Definition at line 1021 of file Constants.cpp.
References llvm::Value::getType(), and llvm::ConstantDataSequential::isElementTypeCompatible().
Referenced by llvm::ConstantInt::get(), llvm::ConstantFP::get(), llvm::Constant::getAllOnesValue(), llvm::ConstantInt::getFalse(), llvm::Constant::getIntegerValue(), llvm::ConstantInt::getTrue(), llvm::ConstantFP::getZeroValueForNegation(), and stripAndComputeConstantOffsets().
| Constant * ConstantVector::getSplatValue | ( | ) | const |
getSplatValue - If this is a splat constant, meaning that all of the elements have the same value, return that value. Otherwise return NULL.
getSplatValue - If this is a splat constant, where all of the elements have the same value, return that value. Otherwise return null.
Reimplemented from llvm::Constant.
Definition at line 1288 of file Constants.cpp.
References llvm::User::getNumOperands(), llvm::User::getOperand(), and I.
Referenced by getOperandInfo().
| VectorType* llvm::ConstantVector::getType | ( | ) | const [inline] |
getType - Specialize the getType() method to always return a VectorType, which reduces the amount of casting needed in parts of the compiler.
Reimplemented from llvm::Value.
Definition at line 456 of file Constants.h.
References llvm::Value::getType().
Referenced by ConstantVector(), destroyConstant(), and emitGlobalConstantVector().
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 2683 of file Constants.cpp.
References destroyConstant(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::Value::replaceAllUsesWith(), and llvm::SmallVectorImpl< T >::reserve().
friend struct ConstantArrayCreator< ConstantVector, VectorType > [friend] |
Definition at line 438 of file Constants.h.