LLVM API Documentation

Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
llvm::ConstantVector Class Reference

#include <Constants.h>

Inheritance diagram for llvm::ConstantVector:
Inheritance graph
[legend]
Collaboration diagram for llvm::ConstantVector:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Constant)
 Transparently provide more efficient getOperand methods.
VectorTypegetType () const
ConstantgetSplatValue () const
void destroyConstant () override
void replaceUsesOfWithOnConstant (Value *From, Value *To, Use *U) override

Static Public Member Functions

static Constantget (ArrayRef< Constant * > V)
static ConstantgetSplat (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 ConstantAggrKeyType< ConstantVector >

Detailed Description

ConstantVector - Constant Vector Declarations

Definition at line 437 of file Constants.h.


Constructor & Destructor Documentation

ConstantVector::ConstantVector ( VectorType T,
ArrayRef< Constant * >  Val 
) [protected]

Member Function Documentation

static bool llvm::ConstantVector::classof ( const Value V) [inline, static]

Methods for support type inquiry through isa, cast, and dyn_cast:

Reimplemented from llvm::Constant.

Definition at line 472 of file Constants.h.

References llvm::Value::getValueID().

Transparently provide more efficient getOperand methods.

void ConstantVector::destroyConstant ( ) [override, 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 1368 of file Constants.cpp.

References llvm::Constant::destroyConstantImpl(), llvm::Type::getContext(), getType(), llvm::LLVMContext::pImpl, llvm::ConstantUniqueMap< ConstantClass >::remove(), and llvm::LLVMContextImpl::VectorConstants.

Constant * ConstantVector::getSplat ( unsigned  NumElts,
Constant Elt 
) [static]

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 1388 of file Constants.cpp.

References llvm::User::getNumOperands(), llvm::User::getOperand(), and I.

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 460 of file Constants.h.

References llvm::Value::getType().

Referenced by ConstantVector(), destroyConstant(), and emitGlobalConstantVector().

void ConstantVector::replaceUsesOfWithOnConstant ( Value ,
Value ,
Use  
) [override, virtual]

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 2849 of file Constants.cpp.

References llvm::Value::getContext(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::User::OperandList, llvm::Constant::replaceUsesOfWithOnConstantImpl(), and llvm::SmallVectorImpl< T >::reserve().


Friends And Related Function Documentation

friend struct ConstantAggrKeyType< ConstantVector > [friend]

Definition at line 438 of file Constants.h.


The documentation for this class was generated from the following files: