LLVM  mainline
Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends
llvm::ConstantDataArray Class Reference

ConstantDataArray - An array 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. More...

#include <Constants.h>

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

List of all members.

Public Member Functions

ArrayTypegetType () const
 getType - Specialize the getType() method to always return an ArrayType, which reduces the amount of casting needed in parts of the compiler.

Static Public Member Functions

static Constantget (LLVMContext &Context, ArrayRef< uint8_t > Elts)
 get() constructors - Return a constant with array type with an element count and element type matching the ArrayRef passed in.
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 ConstantgetFP (LLVMContext &Context, ArrayRef< uint16_t > Elts)
 getFP() constructors - Return a constant with array type with an element count and element type of float with precision matching the number of bits in the ArrayRef passed in.
static ConstantgetFP (LLVMContext &Context, ArrayRef< uint32_t > Elts)
static ConstantgetFP (LLVMContext &Context, ArrayRef< uint64_t > Elts)
static ConstantgetString (LLVMContext &Context, StringRef Initializer, bool AddNull=true)
 getString - This method constructs a CDS and initializes it with a text string.
static bool classof (const Value *V)
 Methods for support type inquiry through isa, cast, and dyn_cast:

Protected Member Functions

void * operator new (size_t s)
 Allocate a User with an operand pointer co-allocated.

Friends

class ConstantDataSequential

Detailed Description

ConstantDataArray - An array 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 679 of file Constants.h.


Member Function Documentation

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

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

Reimplemented from llvm::ConstantDataSequential.

Definition at line 729 of file Constants.h.

References llvm::Value::getValueID().

Constant * ConstantDataArray::get ( LLVMContext Context,
ArrayRef< uint8_t >  Elts 
) [static]

get() constructors - Return a constant with array type with an element count and element type matching the ArrayRef passed in.

Note that this can return a ConstantAggregateZero object.

Definition at line 2550 of file Constants.cpp.

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

Referenced by get(), and getFP().

Constant * ConstantDataArray::get ( LLVMContext Context,
ArrayRef< uint16_t >  Elts 
) [static]
Constant * ConstantDataArray::get ( LLVMContext Context,
ArrayRef< uint32_t >  Elts 
) [static]
Constant * ConstantDataArray::get ( LLVMContext Context,
ArrayRef< uint64_t >  Elts 
) [static]
Constant * ConstantDataArray::get ( LLVMContext Context,
ArrayRef< float >  Elts 
) [static]
Constant * ConstantDataArray::get ( LLVMContext Context,
ArrayRef< double >  Elts 
) [static]
Constant * ConstantDataArray::getFP ( LLVMContext Context,
ArrayRef< uint16_t >  Elts 
) [static]

getFP() constructors - Return a constant with array type with an element count and element type of float with precision matching the number of bits in the ArrayRef passed in.

(i.e. half for 16bits, float for 32bits, double for 64bits) Note that this can return a ConstantAggregateZero object.

Definition at line 2586 of file Constants.cpp.

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

Constant * ConstantDataArray::getFP ( LLVMContext Context,
ArrayRef< uint32_t >  Elts 
) [static]
Constant * ConstantDataArray::getFP ( LLVMContext Context,
ArrayRef< uint64_t >  Elts 
) [static]
Constant * ConstantDataArray::getString ( LLVMContext Context,
StringRef  Str,
bool  AddNull = true 
) [static]

getString - This method constructs a CDS and initializes it with a text string.

The default behavior (AddNull==true) causes a null terminator to be placed at the end of the array (increasing the length of the string by one more than the StringRef would normally indicate. Pass AddNull=false to disable this behavior.

Definition at line 2610 of file Constants.cpp.

References llvm::SmallVectorImpl< T >::append(), llvm::StringRef::begin(), llvm::StringRef::data(), llvm::Data, llvm::StringRef::end(), llvm::makeArrayRef(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and llvm::StringRef::size().

Referenced by createPrivateGlobalForString(), createPrivateNonConstGlobalForString(), and LLVMConstStringInContext().

getType - Specialize the getType() method to always return an ArrayType, which reduces the amount of casting needed in parts of the compiler.

Reimplemented from llvm::ConstantDataSequential.

Definition at line 723 of file Constants.h.

Referenced by llvm::getConstantStringInfo().

void* llvm::ConstantDataArray::operator new ( size_t  Size) [inline, protected]

Allocate a User with an operand pointer co-allocated.

This is used for subclasses which need to allocate a variable number of operands, ie, 'hung off uses'.

Reimplemented from llvm::ConstantDataSequential.

Definition at line 688 of file Constants.h.

References operator new().


Friends And Related Function Documentation

friend class ConstantDataSequential [friend]

Definition at line 683 of file Constants.h.


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