LLVM API Documentation

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

#include <Constants.h>

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

List of all members.

Public Member Functions

ConstantgetSplatValue () const
VectorTypegetType () const

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)

Protected Member Functions

void * operator new (size_t s)

Friends

class ConstantDataSequential

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) [inline, static]

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

Reimplemented from llvm::ConstantDataSequential.

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

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

Referenced by llvm::ConstantVector::get(), get(), OptimizeVectorResize(), and llvm::InstCombiner::visitCallInst().

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

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

getSplatValue - If this is a splat constant, meaning that all of the elements have the same value, return that value. Otherwise return NULL.

Reimplemented from llvm::Constant.

Definition at line 2606 of file Constants.cpp.

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

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::ConstantDataSequential.

Definition at line 733 of file Constants.h.

void* llvm::ConstantDataVector::operator new ( size_t  s) [inline, protected]

Reimplemented from llvm::ConstantDataSequential.

Definition at line 706 of file Constants.h.

References operator new().


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: