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 half/bfloat/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:570
Inherits from: ConstantData
Member Variables
- private const char* DataElements
- A pointer to the bytes underlying this constant (which is owned by the uniquing StringMap).
- private std::unique_ptr<ConstantDataSequential> Next
- This forms a link list of ConstantDataSequential nodes that have the same value but different type. For example, 0,0,0,1 could be a 4 element array of i8, or a 1-element array of i32. They'll both end up in the same StringMap bucket, linked up.
Inherited from Value:
- protected SubclassOptionalData
- protected NumUserOperands
- protected IsUsedByMD
- protected HasName
- protected HasMetadata
- protected HasHungOffUses
- protected HasDescriptor
- public static MaxAlignmentExponent = 32
- public static MaximumAlignment = 1ULL << MaxAlignmentExponent
Method Overview
- protected ConstantDataSequential(llvm::Type * ty, llvm::Value::ValueTy VT, const char * Data)
- public ConstantDataSequential(const llvm::ConstantDataSequential &)
- public static bool classof(const llvm::Value * V)
- private void destroyConstantImpl()
- public llvm::StringRef getAsCString() const
- public llvm::StringRef getAsString() const
- public llvm::APFloat getElementAsAPFloat(unsigned int i) const
- public llvm::APInt getElementAsAPInt(unsigned int i) const
- public llvm::Constant * getElementAsConstant(unsigned int i) const
- public double getElementAsDouble(unsigned int i) const
- public float getElementAsFloat(unsigned int i) const
- public uint64_t getElementAsInteger(unsigned int i) const
- public uint64_t getElementByteSize() const
- private const char * getElementPointer(unsigned int Elt) const
- public llvm::Type * getElementType() const
- protected static llvm::Constant * getImpl(llvm::StringRef Bytes, llvm::Type * Ty)
- public unsigned int getNumElements() const
- public llvm::StringRef getRawDataValues() const
- public bool isCString() const
- public static bool isElementTypeCompatible(llvm::Type * Ty)
- public bool isString(unsigned int CharSize = 8) const
Inherited from ConstantData:
Inherited from Constant:
- public classof
- public containsConstantExpression
- public containsPoisonElement
- public containsUndefOrPoisonElement
- public destroyConstant
- public getAggregateElement
- public getAggregateElement
- public getAllOnesValue
- public getIntegerValue
- public getNullValue
- public getSplatValue
- public getUniqueInteger
- public handleOperandChange
- public hasExactInverseFP
- public hasOneLiveUse
- public hasZeroLiveUses
- public isAllOnesValue
- public isConstantUsed
- public isDLLImportDependent
- public isElementWiseEqual
- public isFiniteNonZeroFP
- public isManifestConstant
- public isMinSignedValue
- public isNaN
- public isNegativeZeroValue
- public isNormalFP
- public isNotMinSignedValue
- public isNotOneValue
- public isNullValue
- public isOneValue
- public isThreadDependent
- public isZeroValue
- public mergeUndefsWith
- public needsDynamicRelocation
- public needsRelocation
- public removeDeadConstantUsers
- public replaceUndefsWith
- public stripPointerCasts
- public stripPointerCasts
Inherited from User:
- protected Op
- protected Op
- protected OpFrom
- protected allocHungoffUses
- public classof
- public dropAllReferences
- public getDescriptor
- public getDescriptor
- public getNumOperands
- public getOperand
- public getOperandList
- public getOperandList
- public getOperandUse
- public getOperandUse
- protected growHungoffUses
- public isDroppable
- public op_begin
- public op_begin
- public op_end
- public op_end
- public operand_values
- public operand_values
- public operands
- public operands
- public replaceUsesOfWith
- public setGlobalVariableNumOperands
- public setNumHungOffUseOperands
- public setOperand
- public value_op_begin
- public value_op_begin
- public value_op_end
- public value_op_end
Inherited from Value:
- public DoPHITranslation
- public DoPHITranslation
- protected addMetadata
- protected addMetadata
- public addUse
- public assertModuleIsMaterialized
- public assertModuleIsMaterializedImpl
- public canBeFreed
- protected clearMetadata
- public clearSubclassOptionalData
- public deleteValue
- public dropDroppableUse
- public dropDroppableUses
- public dropDroppableUsesIn
- public dump
- protected eraseMetadata
- protected getAllMetadata
- public getContext
- protected getMetadata
- protected getMetadata
- protected getMetadata
- protected getMetadata
- public getName
- public getNameOrAsOperand
- public getNumUses
- public getPointerAlignment
- public getPointerDereferenceableBytes
- public getRawSubclassOptionalData
- public getSingleUndroppableUse
- public getSingleUndroppableUse
- protected getSubclassDataFromValue
- public getType
- public getUniqueUndroppableUser
- public getUniqueUndroppableUser
- public getValueID
- public getValueName
- protected hasMetadata
- protected hasMetadata
- protected hasMetadata
- public hasNUndroppableUses
- public hasNUndroppableUsesOrMore
- public hasNUses
- public hasNUsesOrMore
- public hasName
- public hasOneUse
- public hasOneUser
- public hasSameSubclassOptionalData
- public hasValueHandle
- public isSwiftError
- public isTransitiveUsedByMetadataOnly
- public isUsedByMetadata
- public isUsedInBasicBlock
- public materialized_use_begin
- public materialized_use_begin
- public materialized_use_empty
- public materialized_user_begin
- public materialized_user_begin
- public materialized_users
- public materialized_users
- public materialized_uses
- public materialized_uses
- public mutateType
- public print
- public print
- public printAsOperand
- public printAsOperand
- public replaceAllUsesWith
- public replaceNonMetadataUsesWith
- public replaceUsesOutsideBlock
- public replaceUsesWithIf
- public reverseUseList
- protected setMetadata
- protected setMetadata
- public setName
- public setValueName
- protected setValueSubclassData
- public sortUseList
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsOffsets
- public stripInBoundsOffsets
- public stripPointerCasts
- public stripPointerCasts
- public stripPointerCastsAndAliases
- public stripPointerCastsAndAliases
- public stripPointerCastsForAliasAnalysis
- public stripPointerCastsForAliasAnalysis
- public stripPointerCastsSameRepresentation
- public stripPointerCastsSameRepresentation
- public takeName
- public use_begin
- public use_begin
- public use_empty
- public use_end
- public use_end
- public user_back
- public user_back
- public user_begin
- public user_begin
- public user_empty
- public user_end
- public user_end
- public users
- public users
- public uses
- public uses
Methods
¶ConstantDataSequential(llvm::Type* ty,
llvm::Value::ValueTy VT,
const char* Data)
ConstantDataSequential(llvm::Type* ty,
llvm::Value::ValueTy VT,
const char* Data)
Declared at: llvm/include/llvm/IR/Constants.h:587
Parameters
- llvm::Type* ty
- llvm::Value::ValueTy VT
- const char* Data
¶ConstantDataSequential(
const llvm::ConstantDataSequential&)
ConstantDataSequential(
const llvm::ConstantDataSequential&)
Declared at: llvm/include/llvm/IR/Constants.h:593
Parameters
- const llvm::ConstantDataSequential&
¶static bool classof(const llvm::Value* V)
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:664
Parameters
- const llvm::Value* V
¶void destroyConstantImpl()
void destroyConstantImpl()
Declared at: llvm/include/llvm/IR/Constants.h:584
¶llvm::StringRef getAsCString() const
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:652
¶llvm::StringRef getAsString() const
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:645
¶llvm::APFloat getElementAsAPFloat(
unsigned int i) const
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:611
Parameters
- unsigned int i
¶llvm::APInt getElementAsAPInt(
unsigned int i) const
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:607
Parameters
- unsigned int i
¶llvm::Constant* getElementAsConstant(
unsigned int i) const
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:624
Parameters
- unsigned int i
¶double getElementAsDouble(unsigned int i) const
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:619
Parameters
- unsigned int i
¶float getElementAsFloat(unsigned int i) const
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:615
Parameters
- unsigned int i
¶uint64_t getElementAsInteger(unsigned int i) const
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:603
Parameters
- unsigned int i
¶uint64_t getElementByteSize() const
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:634
¶const char* getElementPointer(
unsigned int Elt) const
const char* getElementPointer(
unsigned int Elt) const
Declared at: llvm/include/llvm/IR/Constants.h:670
Parameters
- unsigned int Elt
¶llvm::Type* getElementType() const
llvm::Type* getElementType() const
Description
Return the element type of the array/vector.
Declared at: llvm/include/llvm/IR/Constants.h:627
¶static llvm::Constant* getImpl(
llvm::StringRef Bytes,
llvm::Type* Ty)
static llvm::Constant* getImpl(
llvm::StringRef Bytes,
llvm::Type* Ty)
Declared at: llvm/include/llvm/IR/Constants.h:590
Parameters
- llvm::StringRef Bytes
- llvm::Type* Ty
¶unsigned int getNumElements() const
unsigned int getNumElements() const
Description
Return the number of elements in the array or vector.
Declared at: llvm/include/llvm/IR/Constants.h:630
¶llvm::StringRef getRawDataValues() const
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:661
¶bool isCString() const
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:641
¶static bool isElementTypeCompatible(
llvm::Type* Ty)
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:599
Parameters
- llvm::Type* Ty
¶bool isString(unsigned int CharSize = 8) const
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:637
Parameters
- unsigned int CharSize = 8