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 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 645 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 686 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 2346 of file Constants.cpp.

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

Referenced by llvm::ConstantArray::get(), and get().

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

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

Referenced by llvm::IRBuilderBase::CreateGlobalString(), 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 680 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 654 of file Constants.h.

References operator new().


Friends And Related Function Documentation

friend class ConstantDataSequential [friend]

Definition at line 649 of file Constants.h.


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