class ConstantDataSequential

Declaration

class ConstantDataSequential : public ConstantData { /* full declaration omitted */ };

Description

ConstantDataSequential - A vector or 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. This is the common base class of ConstantDataArray and ConstantDataVector.

Declared at: llvm/include/llvm/IR/Constants.h:574

Inherits from: ConstantData

Member Variables

Inherited from Value:

protected SubclassOptionalData
protected NumUserOperands
protected IsUsedByMD
protected HasName
protected HasHungOffUses
protected HasDescriptor
public static MaxAlignmentExponent = 29
public static MaximumAlignment = 1U << MaxAlignmentExponent

Method Overview

Inherited from ConstantData:

Inherited from Constant:

Inherited from User:

Inherited from Value:

Methods

ConstantDataSequential(
    const llvm::ConstantDataSequential&)

Declared at: llvm/include/llvm/IR/Constants.h:598

Parameters

const llvm::ConstantDataSequential&

ConstantDataSequential(llvm::Type* ty,
                       llvm::Value::ValueTy VT,
                       const char* Data)

Declared at: llvm/include/llvm/IR/Constants.h:591

Parameters

llvm::Type* ty
llvm::Value::ValueTy VT
const char* Data

static bool classof(const llvm::Value* V)

Description

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

Declared at: llvm/include/llvm/IR/Constants.h:675

Parameters

const llvm::Value* V

llvm::StringRef getAsCString() const

Description

If this array is isCString(), then this method returns the array (without the trailing null byte) as a StringRef. Otherwise, it asserts out.

Declared at: llvm/include/llvm/IR/Constants.h:663

llvm::StringRef getAsString() const

Description

If this array is isString(), then this method returns the array as a StringRef. Otherwise, it asserts out.

Declared at: llvm/include/llvm/IR/Constants.h:656

llvm::APFloat getElementAsAPFloat(
    unsigned int i) const

Description

If this is a sequential container of floating point type, return the specified element as an APFloat.

Declared at: llvm/include/llvm/IR/Constants.h:616

Parameters

unsigned int i

llvm::APInt getElementAsAPInt(
    unsigned int i) const

Description

If this is a sequential container of integers (of any size), return the specified element as an APInt.

Declared at: llvm/include/llvm/IR/Constants.h:612

Parameters

unsigned int i

llvm::Constant* getElementAsConstant(
    unsigned int i) const

Description

Return a Constant for a specified index's element. Note that this has to compute a new constant to return, so it isn't as efficient as getElementAsInteger/Float/Double.

Declared at: llvm/include/llvm/IR/Constants.h:629

Parameters

unsigned int i

double getElementAsDouble(unsigned int i) const

Description

If this is an sequential container of doubles, return the specified element as a double.

Declared at: llvm/include/llvm/IR/Constants.h:624

Parameters

unsigned int i

float getElementAsFloat(unsigned int i) const

Description

If this is an sequential container of floats, return the specified element as a float.

Declared at: llvm/include/llvm/IR/Constants.h:620

Parameters

unsigned int i

uint64_t getElementAsInteger(unsigned int i) const

Description

If this is a sequential container of integers (of any size), return the specified element in the low bits of a uint64_t.

Declared at: llvm/include/llvm/IR/Constants.h:608

Parameters

unsigned int i

uint64_t getElementByteSize() const

Description

Return the size (in bytes) of each element in the array/vector. The size of the elements is known to be a multiple of one byte.

Declared at: llvm/include/llvm/IR/Constants.h:645

llvm::Type* getElementType() const

Description

Return the element type of the array/vector.

Declared at: llvm/include/llvm/IR/Constants.h:638

static llvm::Constant* getImpl(
    llvm::StringRef Bytes,
    llvm::Type* Ty)

Declared at: llvm/include/llvm/IR/Constants.h:595

Parameters

llvm::StringRef Bytes
llvm::Type* Ty

unsigned int getNumElements() const

Description

Return the number of elements in the array or vector.

Declared at: llvm/include/llvm/IR/Constants.h:641

llvm::StringRef getRawDataValues() const

Description

Return the raw, underlying, bytes of this data. Note that this is an extremely tricky thing to work with, as it exposes the host endianness of the data elements.

Declared at: llvm/include/llvm/IR/Constants.h:672

inline llvm::SequentialType* getType() const

Description

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

Declared at: llvm/include/llvm/IR/Constants.h:633

bool isCString() const

Description

This method returns true if the array "isString", ends with a null byte, and does not contains any other null bytes.

Declared at: llvm/include/llvm/IR/Constants.h:652

static bool isElementTypeCompatible(
    llvm::Type* Ty)

Description

Return true if a ConstantDataSequential can be formed with a vector or array of the specified element type. ConstantDataArray only works with normal float and int types that are stored densely in memory, not with things like i42 or x86_f80.

Declared at: llvm/include/llvm/IR/Constants.h:604

Parameters

llvm::Type* Ty

bool isString(unsigned int CharSize = 8) const

Description

This method returns true if this is an array of \p CharSize integers.

Declared at: llvm/include/llvm/IR/Constants.h:648

Parameters

unsigned int CharSize = 8

~ConstantDataSequential()

Declared at: llvm/include/llvm/IR/Constants.h:593