class ConstantStruct

Declaration

class ConstantStruct : public ConstantAggregate { /* full declaration omitted */ };

Description

Base class for aggregate constants (with operands). These constants are aggregates of other constants, which are stored as operands. Subclasses are \a ConstantStruct, \a ConstantArray, and \a ConstantVector.

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

Inherits from: ConstantAggregate

Member Variables

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

  • private ConstantStruct(llvm::StructType * T, ArrayRef<llvm::Constant *> Val)
  • public static bool classof(const llvm::Value * V)
  • private void destroyConstantImpl()
  • public static llvm::Constant * get(llvm::StructType * T, ArrayRef<llvm::Constant *> V)
  • public template <typename... Csts>static std::enable_if_t<are_base_of<Constant, Csts...>::value, Constant *> get(llvm::StructType * T, Csts *... Vs)
  • public static llvm::Constant * getAnon(ArrayRef<llvm::Constant *> V, bool Packed = false)
  • public static llvm::Constant * getAnon(llvm::LLVMContext & Ctx, ArrayRef<llvm::Constant *> V, bool Packed = false)
  • public inline llvm::StructType * getType() const
  • public static llvm::StructType * getTypeForElements(ArrayRef<llvm::Constant *> V, bool Packed = false)
  • public static llvm::StructType * getTypeForElements(llvm::LLVMContext & Ctx, ArrayRef<llvm::Constant *> V, bool Packed = false)
  • private llvm::Value * handleOperandChangeImpl(llvm::Value * From, llvm::Value * To)

Inherited from ConstantAggregate:

Inherited from Constant:

Inherited from User:

Inherited from Value:

Methods

ConstantStruct(llvm::StructType* T,
               ArrayRef<llvm::Constant*> Val)

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

Parameters

llvm::StructType* T
ArrayRef<llvm::Constant*> Val

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:486

Parameters

const llvm::Value* V

void destroyConstantImpl()

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

static llvm::Constant* get(
    llvm::StructType* T,
    ArrayRef<llvm::Constant*> V)

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

Parameters

llvm::StructType* T
ArrayRef<llvm::Constant*> V

template <typename... Csts>
static std::enable_if_t<
    are_base_of<Constant, Csts...>::value,
    Constant*>
get(llvm::StructType* T, Csts*... Vs)

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

Templates

Csts

Parameters

llvm::StructType* T
Csts*... Vs

static llvm::Constant* getAnon(
    ArrayRef<llvm::Constant*> V,
    bool Packed = false)

Description

Return an anonymous struct that has the specified elements. If the struct is possibly empty, then you must specify a context.

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

Parameters

ArrayRef<llvm::Constant*> V
bool Packed = false

static llvm::Constant* getAnon(
    llvm::LLVMContext& Ctx,
    ArrayRef<llvm::Constant*> V,
    bool Packed = false)

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

Parameters

llvm::LLVMContext& Ctx
ArrayRef<llvm::Constant*> V
bool Packed = false

inline llvm::StructType* getType() const

Description

Specialization - reduce amount of casting.

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

static llvm::StructType* getTypeForElements(
    ArrayRef<llvm::Constant*> V,
    bool Packed = false)

Description

Return an anonymous struct type to use for a constant with the specified set of elements. The list must not be empty.

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

Parameters

ArrayRef<llvm::Constant*> V
bool Packed = false

static llvm::StructType* getTypeForElements(
    llvm::LLVMContext& Ctx,
    ArrayRef<llvm::Constant*> V,
    bool Packed = false)

Description

This version of the method allows an empty list.

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

Parameters

llvm::LLVMContext& Ctx
ArrayRef<llvm::Constant*> V
bool Packed = false

llvm::Value* handleOperandChangeImpl(
    llvm::Value* From,
    llvm::Value* To)

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

Parameters

llvm::Value* From
llvm::Value* To