LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
llvm::ConstantDataVector Class Reference

#include <Constants.h>

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

Public Member Functions

ConstantgetSplatValue () const
 
VectorTypegetType () const
 
- Public Member Functions inherited from llvm::ConstantDataSequential
uint64_t getElementAsInteger (unsigned i) const
 
APFloat getElementAsAPFloat (unsigned i) const
 
float getElementAsFloat (unsigned i) const
 
double getElementAsDouble (unsigned i) const
 
ConstantgetElementAsConstant (unsigned i) const
 
SequentialTypegetType () const
 
TypegetElementType () const
 getElementType - Return the element type of the array/vector. More...
 
unsigned getNumElements () const
 getNumElements - Return the number of elements in the array or vector. More...
 
uint64_t getElementByteSize () const
 getElementByteSize - Return the size in bytes of the elements in the data. More...
 
bool isString () const
 isString - This method returns true if this is an array of i8. More...
 
bool isCString () const
 
StringRef getAsString () const
 
StringRef getAsCString () const
 
StringRef getRawDataValues () const
 
virtual void destroyConstant ()
 
- Public Member Functions inherited from llvm::Constant
bool isNullValue () const
 
bool isAllOnesValue () const
 
bool isNegativeZeroValue () const
 
bool isZeroValue () const
 Return true if the value is negative zero or null value. More...
 
bool canTrap () const
 
bool isThreadDependent () const
 isThreadDependent - Return true if the value can vary between threads. More...
 
bool isConstantUsed () const
 
PossibleRelocationsTy getRelocationInfo () const
 
ConstantgetAggregateElement (unsigned Elt) const
 
ConstantgetAggregateElement (Constant *Elt) const
 
ConstantgetSplatValue () const
 
const APIntgetUniqueInteger () const
 
virtual void replaceUsesOfWithOnConstant (Value *, Value *, Use *)
 
void removeDeadConstantUsers () const
 
- Public Member Functions inherited from llvm::User
 ~User ()
 
void operator delete (void *Usr)
 operator delete - free memory allocated for User and Use objects More...
 
void operator delete (void *, unsigned)
 placement delete - required by std, but never called. More...
 
void operator delete (void *, unsigned, bool)
 placement delete - required by std, but never called. More...
 
ValuegetOperand (unsigned i) const
 
void setOperand (unsigned i, Value *Val)
 
const UsegetOperandUse (unsigned i) const
 
UsegetOperandUse (unsigned i)
 
unsigned getNumOperands () const
 
op_iterator op_begin ()
 
const_op_iterator op_begin () const
 
op_iterator op_end ()
 
const_op_iterator op_end () const
 
value_op_iterator value_op_begin ()
 
value_op_iterator value_op_end ()
 
void dropAllReferences ()
 
void replaceUsesOfWith (Value *From, Value *To)
 
- Public Member Functions inherited from llvm::Value
virtual ~Value ()
 
void dump () const
 dump - Support for debugging, callable in GDB: V->dump() More...
 
void print (raw_ostream &O, AssemblyAnnotationWriter *AAW=0) const
 
TypegetType () const
 
LLVMContextgetContext () const
 All values hold a context through their type. More...
 
bool hasName () const
 
ValueNamegetValueName () const
 
void setValueName (ValueName *VN)
 
StringRef getName () const
 
void setName (const Twine &Name)
 
void takeName (Value *V)
 
void replaceAllUsesWith (Value *V)
 
bool use_empty () const
 
use_iterator use_begin ()
 
const_use_iterator use_begin () const
 
use_iterator use_end ()
 
const_use_iterator use_end () const
 
Useruse_back ()
 
const Useruse_back () const
 
bool hasOneUse () const
 
bool hasNUses (unsigned N) const
 
bool hasNUsesOrMore (unsigned N) const
 
bool isUsedInBasicBlock (const BasicBlock *BB) const
 
unsigned getNumUses () const
 
void addUse (Use &U)
 
unsigned getValueID () const
 
unsigned getRawSubclassOptionalData () const
 
void clearSubclassOptionalData ()
 
bool hasSameSubclassOptionalData (const Value *V) const
 
void intersectOptionalDataWith (const Value *V)
 
bool hasValueHandle () const
 
ValuestripPointerCasts ()
 Strips off any unneeded pointer casts, all-zero GEPs and aliases from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCasts () const
 
ValuestripPointerCastsNoFollowAliases ()
 Strips off any unneeded pointer casts and all-zero GEPs from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCastsNoFollowAliases () const
 
ValuestripInBoundsConstantOffsets ()
 Strips off unneeded pointer casts and all-constant GEPs from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsConstantOffsets () const
 
ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset)
 Strips like stripInBoundsConstantOffsets but also accumulates the constant offset stripped. More...
 
const ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const
 
ValuestripInBoundsOffsets ()
 Strips off unneeded pointer casts and any in-bounds offsets from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsOffsets () const
 
bool isDereferenceablePointer () const
 
ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB)
 
const ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const
 
void mutateType (Type *Ty)
 

Static Public Member Functions

static Constantget (LLVMContext &Context, ArrayRef< uint8_t > Elts)
 
static Constantget (LLVMContext &Context, ArrayRef< uint16_t > Elts)
 
static Constantget (LLVMContext &Context, ArrayRef< uint32_t > Elts)
 
static Constantget (LLVMContext &Context, ArrayRef< uint64_t > Elts)
 
static Constantget (LLVMContext &Context, ArrayRef< float > Elts)
 
static Constantget (LLVMContext &Context, ArrayRef< double > Elts)
 
static ConstantgetSplat (unsigned NumElts, Constant *Elt)
 
static bool classof (const Value *V)
 
- Static Public Member Functions inherited from llvm::ConstantDataSequential
static bool isElementTypeCompatible (const Type *Ty)
 
static bool classof (const Value *V)
 
- Static Public Member Functions inherited from llvm::Constant
static bool classof (const Value *V)
 
static ConstantgetNullValue (Type *Ty)
 
static ConstantgetAllOnesValue (Type *Ty)
 Get the all ones value. More...
 
static ConstantgetIntegerValue (Type *Ty, const APInt &V)
 
- Static Public Member Functions inherited from llvm::User
static bool classof (const Value *V)
 

Protected Member Functions

void * operator new (size_t s)
 
- Protected Member Functions inherited from llvm::ConstantDataSequential
 ConstantDataSequential (Type *ty, ValueTy VT, const char *Data)
 
 ~ConstantDataSequential ()
 
void * operator new (size_t s)
 
- Protected Member Functions inherited from llvm::Constant
 Constant (Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
 
void destroyConstantImpl ()
 
- Protected Member Functions inherited from llvm::User
void * operator new (size_t s, unsigned Us)
 
 User (Type *ty, unsigned vty, Use *OpList, unsigned NumOps)
 
UseallocHungoffUses (unsigned) const
 
void dropHungoffUses ()
 
template<int Idx>
UseOp ()
 
template<int Idx>
const UseOp () const
 
- Protected Member Functions inherited from llvm::Value
virtual void printCustom (raw_ostream &O) const
 
 Value (Type *Ty, unsigned scid)
 
unsigned short getSubclassDataFromValue () const
 
void setValueSubclassData (unsigned short D)
 

Friends

class ConstantDataSequential
 

Additional Inherited Members

- Public Types inherited from llvm::Constant
enum  PossibleRelocationsTy { NoRelocation = 0, LocalRelocation = 1, GlobalRelocations = 2 }
 
- Public Types inherited from llvm::User
typedef Useop_iterator
 
typedef const Useconst_op_iterator
 
- Public Types inherited from llvm::Value
enum  ValueTy {
  ArgumentVal, BasicBlockVal, FunctionVal, GlobalAliasVal,
  GlobalVariableVal, UndefValueVal, BlockAddressVal, ConstantExprVal,
  ConstantAggregateZeroVal, ConstantDataArrayVal, ConstantDataVectorVal, ConstantIntVal,
  ConstantFPVal, ConstantArrayVal, ConstantStructVal, ConstantVectorVal,
  ConstantPointerNullVal, MDNodeVal, MDStringVal, InlineAsmVal,
  PseudoSourceValueVal, FixedStackPseudoSourceValueVal, InstructionVal, ConstantFirstVal = FunctionVal,
  ConstantLastVal = ConstantPointerNullVal
}
 
typedef value_use_iterator< Useruse_iterator
 
typedef value_use_iterator
< const User
const_use_iterator
 
- Static Public Attributes inherited from llvm::Value
static const unsigned MaximumAlignment = 1u << 29
 
- Static Protected Member Functions inherited from llvm::ConstantDataSequential
static ConstantgetImpl (StringRef Bytes, Type *Ty)
 
- Static Protected Member Functions inherited from llvm::User
template<int Idx, typename U >
static UseOpFrom (const U *that)
 
- Protected Attributes inherited from llvm::User
UseOperandList
 
unsigned NumOperands
 
- Protected Attributes inherited from llvm::Value
unsigned char SubclassOptionalData: 7
 

Detailed Description

ConstantDataVector - A vector constant whose element type is a simple 1/2/4/8-byte integer or float/double, and whose elements are just simple data values (i.e. ConstantInt/ConstantFP). This Constant node has no operands because it stores all of the elements of the constant as densely packed data, instead of as Value*'s.

Definition at line 697 of file Constants.h.

Member Function Documentation

static bool llvm::ConstantDataVector::classof ( const Value V)
inlinestatic

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

Definition at line 739 of file Constants.h.

References llvm::Value::ConstantDataVectorVal, and llvm::Value::getValueID().

Constant * ConstantDataVector::get ( LLVMContext Context,
ArrayRef< uint8_t >  Elts 
)
static

get() constructors - Return a constant with vector type with an element count and element type matching the ArrayRef passed in. Note that this can return a ConstantAggregateZero object.

Definition at line 2374 of file Constants.cpp.

References llvm::ArrayRef< T >::data(), llvm::VectorType::get(), llvm::ConstantDataSequential::getImpl(), llvm::Type::getInt8Ty(), and llvm::ArrayRef< T >::size().

Referenced by llvm::X86TargetLowering::BuildFILD(), llvm::ConstantVector::get(), and OptimizeVectorResize().

Constant * ConstantDataVector::get ( LLVMContext Context,
ArrayRef< uint16_t >  Elts 
)
static
Constant * ConstantDataVector::get ( LLVMContext Context,
ArrayRef< uint32_t >  Elts 
)
static
Constant * ConstantDataVector::get ( LLVMContext Context,
ArrayRef< uint64_t >  Elts 
)
static
Constant * ConstantDataVector::get ( LLVMContext Context,
ArrayRef< float >  Elts 
)
static
Constant * ConstantDataVector::get ( LLVMContext Context,
ArrayRef< double >  Elts 
)
static
Constant * ConstantDataVector::getSplat ( unsigned  NumElts,
Constant Elt 
)
static

getSplat - Return a ConstantVector with the specified constant in each element. The specified constant has to be a of a compatible type (i8/i16/ i32/i64/float/double) and must be a ConstantFP or ConstantInt.

Definition at line 2405 of file Constants.cpp.

References llvm::Value::getContext(), llvm::ConstantVector::getSplat(), llvm::Value::getType(), and llvm::ConstantDataSequential::isElementTypeCompatible().

Referenced by llvm::ConstantVector::getSplat().

Constant * ConstantDataVector::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.

Definition at line 2533 of file Constants.cpp.

References llvm::StringRef::data(), llvm::ConstantDataSequential::getElementAsConstant(), llvm::ConstantDataSequential::getElementByteSize(), llvm::ConstantDataSequential::getNumElements(), llvm::ConstantDataSequential::getRawDataValues(), and llvm::LibFunc::memcmp.

Referenced by getOperandInfo().

VectorType* llvm::ConstantDataVector::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.

Definition at line 733 of file Constants.h.

References llvm::Value::getType().

void* llvm::ConstantDataVector::operator new ( size_t  s)
inlineprotected

Definition at line 706 of file Constants.h.

Friends And Related Function Documentation

friend class ConstantDataSequential
friend

Definition at line 701 of file Constants.h.


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