class AllocaInst

Declaration

class AllocaInst : public UnaryInstruction { /* full declaration omitted */ };

Declared at: llvm/include/llvm/IR/Instructions.h:59

Inherits from: UnaryInstruction

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

  • public AllocaInst(llvm::Type * Ty, unsigned int AddrSpace, llvm::Value * ArraySize = nullptr, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
  • public AllocaInst(llvm::Type * Ty, unsigned int AddrSpace, llvm::Value * ArraySize, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
  • public AllocaInst(llvm::Type * Ty, unsigned int AddrSpace, const llvm::Twine & Name, llvm::Instruction * InsertBefore = nullptr)
  • public AllocaInst(llvm::Type * Ty, unsigned int AddrSpace, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
  • public AllocaInst(llvm::Type * Ty, unsigned int AddrSpace, llvm::Value * ArraySize, llvm::MaybeAlign Align, const llvm::Twine & Name = "", llvm::Instruction * InsertBefore = nullptr)
  • public AllocaInst(llvm::Type * Ty, unsigned int AddrSpace, llvm::Value * ArraySize, llvm::MaybeAlign Align, const llvm::Twine & Name, llvm::BasicBlock * InsertAtEnd)
  • public static bool classof(const llvm::Value * V)
  • public static bool classof(const llvm::Instruction * I)
  • protected llvm::AllocaInst * cloneImpl() const
  • public unsigned int getAlignment() const
  • public llvm::Type * getAllocatedType() const
  • public Optional<uint64_t> getAllocationSizeInBits(const llvm::DataLayout & DL) const
  • public const llvm::Value * getArraySize() const
  • public llvm::Value * getArraySize()
  • public llvm::PointerType * getType() const
  • public bool isArrayAllocation() const
  • public bool isStaticAlloca() const
  • public bool isSwiftError() const
  • public bool isUsedWithInAlloca() const
  • public void setAlignment(llvm::MaybeAlign Align)
  • public void setAllocatedType(llvm::Type * Ty)
  • public void setSwiftError(bool V)
  • public void setUsedWithInAlloca(bool V)

Inherited from UnaryInstruction:

Inherited from Instruction:

Inherited from User:

Inherited from Value:

Methods

AllocaInst(
    llvm::Type* Ty,
    unsigned int AddrSpace,
    llvm::Value* ArraySize = nullptr,
    const llvm::Twine& Name = "",
    llvm::Instruction* InsertBefore = nullptr)

Declared at: llvm/include/llvm/IR/Instructions.h:69

Parameters

llvm::Type* Ty
unsigned int AddrSpace
llvm::Value* ArraySize = nullptr
const llvm::Twine& Name = ""
llvm::Instruction* InsertBefore = nullptr

AllocaInst(llvm::Type* Ty,
           unsigned int AddrSpace,
           llvm::Value* ArraySize,
           const llvm::Twine& Name,
           llvm::BasicBlock* InsertAtEnd)

Declared at: llvm/include/llvm/IR/Instructions.h:73

Parameters

llvm::Type* Ty
unsigned int AddrSpace
llvm::Value* ArraySize
const llvm::Twine& Name
llvm::BasicBlock* InsertAtEnd

AllocaInst(
    llvm::Type* Ty,
    unsigned int AddrSpace,
    const llvm::Twine& Name,
    llvm::Instruction* InsertBefore = nullptr)

Declared at: llvm/include/llvm/IR/Instructions.h:76

Parameters

llvm::Type* Ty
unsigned int AddrSpace
const llvm::Twine& Name
llvm::Instruction* InsertBefore = nullptr

AllocaInst(llvm::Type* Ty,
           unsigned int AddrSpace,
           const llvm::Twine& Name,
           llvm::BasicBlock* InsertAtEnd)

Declared at: llvm/include/llvm/IR/Instructions.h:78

Parameters

llvm::Type* Ty
unsigned int AddrSpace
const llvm::Twine& Name
llvm::BasicBlock* InsertAtEnd

AllocaInst(
    llvm::Type* Ty,
    unsigned int AddrSpace,
    llvm::Value* ArraySize,
    llvm::MaybeAlign Align,
    const llvm::Twine& Name = "",
    llvm::Instruction* InsertBefore = nullptr)

Declared at: llvm/include/llvm/IR/Instructions.h:81

Parameters

llvm::Type* Ty
unsigned int AddrSpace
llvm::Value* ArraySize
llvm::MaybeAlign Align
const llvm::Twine& Name = ""
llvm::Instruction* InsertBefore = nullptr

AllocaInst(llvm::Type* Ty,
           unsigned int AddrSpace,
           llvm::Value* ArraySize,
           llvm::MaybeAlign Align,
           const llvm::Twine& Name,
           llvm::BasicBlock* InsertAtEnd)

Declared at: llvm/include/llvm/IR/Instructions.h:83

Parameters

llvm::Type* Ty
unsigned int AddrSpace
llvm::Value* ArraySize
llvm::MaybeAlign Align
const llvm::Twine& Name
llvm::BasicBlock* InsertAtEnd

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

Declared at: llvm/include/llvm/IR/Instructions.h:151

Parameters

const llvm::Value* V

static bool classof(const llvm::Instruction* I)

Declared at: llvm/include/llvm/IR/Instructions.h:148

Parameters

const llvm::Instruction* I

llvm::AllocaInst* cloneImpl() const

Declared at: llvm/include/llvm/IR/Instructions.h:66

unsigned int getAlignment() const

Description

Return the alignment of the memory that is being allocated by the instruction.

Declared at: llvm/include/llvm/IR/Instructions.h:112

llvm::Type* getAllocatedType() const

Description

Return the type that is being allocated by the instruction.

Declared at: llvm/include/llvm/IR/Instructions.h:105

Optional<uint64_t> getAllocationSizeInBits(
    const llvm::DataLayout& DL) const

Description

Get allocation size in bits. Returns None if size can't be determined, e.g. in case of a VLA.

Declared at: llvm/include/llvm/IR/Instructions.h:102

Parameters

const llvm::DataLayout& DL

const llvm::Value* getArraySize() const

Description

Get the number of elements allocated. For a simple allocation of a single element, this will return a constant 1 value.

Declared at: llvm/include/llvm/IR/Instructions.h:92

llvm::Value* getArraySize()

Declared at: llvm/include/llvm/IR/Instructions.h:93

llvm::PointerType* getType() const

Description

Overload to return most specific pointer type.

Declared at: llvm/include/llvm/IR/Instructions.h:96

bool isArrayAllocation() const

Description

Return true if there is an allocation size parameter to the allocation instruction that is not 1.

Declared at: llvm/include/llvm/IR/Instructions.h:88

bool isStaticAlloca() const

Description

Return true if this alloca is in the entry block of the function and is a constant size. If so, the code generator will fold it into the prolog/epilog code, so it is basically free.

Declared at: llvm/include/llvm/IR/Instructions.h:122

bool isSwiftError() const

Description

Return true if this alloca is used as a swifterror argument to a call.

Declared at: llvm/include/llvm/IR/Instructions.h:137

bool isUsedWithInAlloca() const

Description

Return true if this alloca is used as an inalloca argument to a call. Such allocas are never considered static even if they are in the entry block.

Declared at: llvm/include/llvm/IR/Instructions.h:126

void setAlignment(llvm::MaybeAlign Align)

Declared at: llvm/include/llvm/IR/Instructions.h:117

Parameters

llvm::MaybeAlign Align

void setAllocatedType(llvm::Type* Ty)

Description

for use only in special circumstances that need to generically transform a whole instruction (eg: IR linking and vectorization).

Declared at: llvm/include/llvm/IR/Instructions.h:108

Parameters

llvm::Type* Ty

void setSwiftError(bool V)

Description

Specify whether this alloca is used to represent a swifterror.

Declared at: llvm/include/llvm/IR/Instructions.h:142

Parameters

bool V

void setUsedWithInAlloca(bool V)

Description

Specify whether this alloca is used to represent the arguments to a call.

Declared at: llvm/include/llvm/IR/Instructions.h:131

Parameters

bool V