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 * > &) |
| get() - Static factory methods - Return objects of the specified value | |
| static Constant * | get (const std::vector< Constant * > &V) |
| static Constant * | get (Constant *const *Vals, unsigned NumVals) |
| static ConstantVector * | getAllOnesValue (const VectorType *Ty) |
| Get the all ones value. | |
| 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 445 of file Constants.h.
| ConstantVector::ConstantVector | ( | const VectorType * | T, | |
| const std::vector< Constant * > & | Val | |||
| ) | [protected] |
Definition at line 428 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] |
get() - Static factory methods - Return objects of the specified value
Definition at line 1491 of file Constants.cpp.
References llvm::CallingConv::C, llvm::UndefValue::get(), and llvm::ConstantAggregateZero::get().
Referenced by llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldCompareInstruction(), llvm::ConstantFoldInsertElementInstruction(), llvm::ConstantFoldShuffleVectorInstruction(), llvm::ConvertConstantType< ConstantVector, VectorType >::convert(), llvm::BinaryOperator::CreateNot(), EvalVectorOp(), getAllOnesValue(), llvm::ConstantExpr::getVFCmp(), llvm::ConstantExpr::getVICmp(), llvm::ConstantExpr::getZeroValueForNegationExpr(), llvm::MapValue(), replaceUsesOfWithOnConstant(), llvm::BitcodeReaderValueList::ResolveConstantForwardRefs(), and llvm::UpgradeIntrinsicCall().
| 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 466 of file Constants.h.
References llvm::Intrinsic::getType().
Referenced by replaceUsesOfWithOnConstant().
| ConstantVector * ConstantVector::getAllOnesValue | ( | const VectorType * | Ty | ) | [static] |
Get the all ones value.
the value for a vector integer constant of the given type that has all its bits set to true.
Definition at line 149 of file Constants.cpp.
References get(), llvm::ConstantInt::getAllOnesValue(), llvm::SequentialType::getElementType(), and llvm::VectorType::getNumElements().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::X86InstrInfo::foldMemoryOperandImpl(), and llvm::Constant::getAllOnesValue().
| 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 478 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 1531 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 1545 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 1522 of file Constants.cpp.
References llvm::Constant::destroyConstantImpl().
Referenced by llvm::ConvertConstantType< 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 2591 of file Constants.cpp.
References destroyConstant(), get(), 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 494 of file Constants.h.
| static bool llvm::ConstantVector::classof | ( | const Value * | V | ) | [inline, static] |
Reimplemented from llvm::Constant.
Definition at line 495 of file Constants.h.
References llvm::Value::getValueID().
friend struct ConstantCreator< ConstantVector, VectorType,std::vector< Constant * > > [friend] |
Definition at line 447 of file Constants.h.