LLVM API Documentation

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

#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

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 ConstantgetFP (LLVMContext &Context, ArrayRef< uint16_t > Elts)
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)
static bool classof (const Value *V)

Protected Member Functions

void * operator new (size_t s)

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

References llvm::Value::ConstantDataArrayVal, and 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 2523 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 2559 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 2583 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 699 of file Constants.h.

Referenced by llvm::getConstantStringInfo().

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

Reimplemented from llvm::ConstantDataSequential.

Definition at line 664 of file Constants.h.

References operator new().


Friends And Related Function Documentation

friend class ConstantDataSequential [friend]

Definition at line 659 of file Constants.h.


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