LLVM API Documentation
#include <Constants.h>
Public Member Functions | |
| DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Constant) | |
| Transparently provide more efficient getOperand methods. | |
| const VectorType * | getType () const |
| virtual bool | isNullValue () const |
| bool | isAllOnesValue () const |
| Determine if the value is all ones. | |
| Constant * | getSplatValue () |
| virtual void | destroyConstant () |
| virtual void | replaceUsesOfWithOnConstant (Value *From, Value *To, Use *U) |
Static Public Member Functions | |
| static Constant * | get (const VectorType *T, const std::vector< Constant * > &V) |
| static Constant * | get (const std::vector< Constant * > &V) |
| static Constant * | get (Constant *const *Vals, unsigned NumVals) |
| static bool | classof (const ConstantVector *) |
| Methods for support type inquiry through isa, cast, and dyn_cast:. | |
| static bool | classof (const Value *V) |
Protected Member Functions | |
| ConstantVector (const VectorType *T, const std::vector< Constant * > &Val) | |
Friends | |
| struct | ConstantCreator< ConstantVector, VectorType, std::vector< Constant * > > |
Definition at line 458 of file Constants.h.
| ConstantVector::ConstantVector | ( | const VectorType * | T, | |
| const std::vector< Constant * > & | Val | |||
| ) | [protected] |
Definition at line 575 of file Constants.cpp.
References llvm::CallingConv::C, E, llvm::SequentialType::getElementType(), llvm::Value::getType(), llvm::Type::getTypeID(), llvm::Type::isAbstract(), and llvm::User::OperandList.
| Constant * ConstantVector::get | ( | const VectorType * | T, | |
| const std::vector< Constant * > & | V | |||
| ) | [static] |
Definition at line 593 of file Constants.cpp.
References llvm::CallingConv::C, Context, llvm::UndefValue::get(), llvm::ConstantAggregateZero::get(), llvm::Type::getContext(), llvm::Constant::isNullValue(), llvm::LLVMContext::pImpl, and llvm::LLVMContextImpl::VectorConstants.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldCompareInstruction(), llvm::ConstantFoldInsertElementInstruction(), llvm::ConstantFoldShuffleVectorInstruction(), llvm::ConvertConstant< ConstantVector, VectorType >::convert(), llvm::BinaryOperator::CreateNot(), llvm::ConstantFP::get(), llvm::ConstantInt::get(), llvm::Constant::getAllOnesValue(), llvm::Constant::getIntegerValue(), llvm::ConstantFP::getZeroValueForNegation(), llvm::MapValue(), llvm::BitcodeReaderValueList::ResolveConstantForwardRefs(), and llvm::UpgradeIntrinsicCall().
Definition at line 627 of file Constants.cpp.
| llvm::ConstantVector::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Constant | ) |
Transparently provide more efficient getOperand methods.
| const 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 476 of file Constants.h.
References llvm::Intrinsic::getType().
Referenced by destroyConstant(), and replaceUsesOfWithOnConstant().
| virtual bool llvm::ConstantVector::isNullValue | ( | ) | const [inline, virtual] |
isNullValue - Return true if this is the value that would be returned by getNullValue. This always returns false because zero vectors are always created as ConstantAggregateZero objects.
Implements llvm::Constant.
Definition at line 483 of file Constants.h.
| bool ConstantVector::isAllOnesValue | ( | ) | const |
Determine if the value is all ones.
This function will return true iff every element in this vector constant is set to all ones.
Definition at line 959 of file Constants.cpp.
References llvm::dyn_cast(), E, llvm::User::getNumOperands(), llvm::Constant::getOperand(), and llvm::ConstantInt::isAllOnesValue().
| Constant * ConstantVector::getSplatValue | ( | ) |
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.
Definition at line 973 of file Constants.cpp.
References E, llvm::User::getNumOperands(), and llvm::Constant::getOperand().
| 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 949 of file Constants.cpp.
References llvm::Constant::destroyConstantImpl(), llvm::Type::getContext(), getType(), llvm::LLVMContext::pImpl, and llvm::LLVMContextImpl::VectorConstants.
Referenced by llvm::ConvertConstant< ConstantVector, VectorType >::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 1999 of file Constants.cpp.
References destroyConstant(), llvm::User::getNumOperands(), llvm::Constant::getOperand(), getType(), llvm::Value::uncheckedReplaceAllUsesWith(), Val, and Values.
| static bool llvm::ConstantVector::classof | ( | const ConstantVector * | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:.
Definition at line 499 of file Constants.h.
Reimplemented from llvm::Constant.
Definition at line 500 of file Constants.h.
References llvm::Value::getValueID().
friend struct ConstantCreator< ConstantVector, VectorType,std::vector< Constant * > > [friend] |
Definition at line 460 of file Constants.h.