LLVM API Documentation

Public Member Functions | Static Public Member Functions | Protected Member Functions
llvm::AllocaInst Class Reference

#include <Instructions.h>

Inheritance diagram for llvm::AllocaInst:
Inheritance graph
[legend]
Collaboration diagram for llvm::AllocaInst:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 AllocaInst (Type *Ty, Value *ArraySize=nullptr, const Twine &Name="", Instruction *InsertBefore=nullptr)
 AllocaInst (Type *Ty, Value *ArraySize, const Twine &Name, BasicBlock *InsertAtEnd)
 AllocaInst (Type *Ty, const Twine &Name, Instruction *InsertBefore=nullptr)
 AllocaInst (Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd)
 AllocaInst (Type *Ty, Value *ArraySize, unsigned Align, const Twine &Name="", Instruction *InsertBefore=nullptr)
 AllocaInst (Type *Ty, Value *ArraySize, unsigned Align, const Twine &Name, BasicBlock *InsertAtEnd)
virtual ~AllocaInst ()
bool isArrayAllocation () const
const ValuegetArraySize () const
ValuegetArraySize ()
PointerTypegetType () const
TypegetAllocatedType () const
unsigned getAlignment () const
void setAlignment (unsigned Align)
bool isStaticAlloca () const
bool isUsedWithInAlloca () const
 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.
void setUsedWithInAlloca (bool V)
 Specify whether this alloca is used to represent the arguments to a call.

Static Public Member Functions

static bool classof (const Instruction *I)
static bool classof (const Value *V)
 Methods for support type inquiry through isa, cast, and dyn_cast:

Protected Member Functions

AllocaInstclone_impl () const override

Detailed Description

AllocaInst - an instruction to allocate memory on the stack

Definition at line 75 of file Instructions.h.


Constructor & Destructor Documentation

AllocaInst::AllocaInst ( Type Ty,
Value ArraySize = nullptr,
const Twine Name = "",
Instruction InsertBefore = nullptr 
) [explicit]

Definition at line 834 of file Instructions.cpp.

References llvm::Type::isVoidTy(), setAlignment(), and llvm::Value::setName().

Referenced by clone_impl().

AllocaInst::AllocaInst ( Type Ty,
Value ArraySize,
const Twine Name,
BasicBlock InsertAtEnd 
)

Definition at line 843 of file Instructions.cpp.

References llvm::Type::isVoidTy(), setAlignment(), and llvm::Value::setName().

AllocaInst::AllocaInst ( Type Ty,
const Twine Name,
Instruction InsertBefore = nullptr 
)

Definition at line 852 of file Instructions.cpp.

References llvm::Type::isVoidTy(), setAlignment(), and llvm::Value::setName().

AllocaInst::AllocaInst ( Type Ty,
const Twine Name,
BasicBlock InsertAtEnd 
)

Definition at line 861 of file Instructions.cpp.

References llvm::Type::isVoidTy(), setAlignment(), and llvm::Value::setName().

AllocaInst::AllocaInst ( Type Ty,
Value ArraySize,
unsigned  Align,
const Twine Name = "",
Instruction InsertBefore = nullptr 
)

Definition at line 870 of file Instructions.cpp.

References llvm::Type::isVoidTy(), setAlignment(), and llvm::Value::setName().

AllocaInst::AllocaInst ( Type Ty,
Value ArraySize,
unsigned  Align,
const Twine Name,
BasicBlock InsertAtEnd 
)

Definition at line 879 of file Instructions.cpp.

References llvm::Type::isVoidTy(), setAlignment(), and llvm::Value::setName().

AllocaInst::~AllocaInst ( ) [virtual]

Definition at line 889 of file Instructions.cpp.


Member Function Documentation

static bool llvm::AllocaInst::classof ( const Instruction I) [inline, static]

Reimplemented from llvm::UnaryInstruction.

Definition at line 146 of file Instructions.h.

References llvm::Alloca, and llvm::Instruction::getOpcode().

Referenced by classof().

static bool llvm::AllocaInst::classof ( const Value V) [inline, static]

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

Reimplemented from llvm::UnaryInstruction.

Definition at line 149 of file Instructions.h.

References classof().

AllocaInst * AllocaInst::clone_impl ( ) const [override, protected, virtual]

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

Definition at line 121 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by clone_impl(), llvm::computeKnownBits(), InlineCallIfPossible(), setAlignment(), llvm::ObjectSizeOffsetVisitor::visitAllocaInst(), llvm::InstCombiner::visitAllocaInst(), and WriteInstruction().

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

Definition at line 104 of file Instructions.h.

References llvm::User::getOperand().

Referenced by llvm::InlineFunction(), isStaticAlloca(), llvm::NVPTXAllocaHoisting::runOnFunction(), llvm::ObjectSizeOffsetVisitor::visitAllocaInst(), llvm::InstCombiner::visitAllocaInst(), and llvm::ObjectSizeOffsetEvaluator::visitAllocaInst().

Definition at line 105 of file Instructions.h.

References llvm::User::getOperand().

getType - Overload to return most specific pointer type

Reimplemented from llvm::Value.

Definition at line 109 of file Instructions.h.

Referenced by llvm::computeKnownBits(), getAllocatedType(), hasLifetimeMarkers(), llvm::isAllocaPromotable(), isArray(), llvm::Interpreter::visitAllocaInst(), and llvm::InstCombiner::visitAllocaInst().

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

Definition at line 901 of file Instructions.cpp.

References llvm::User::getOperand().

Referenced by InlineCallIfPossible(), isArray(), llvm::ObjectSizeOffsetVisitor::visitAllocaInst(), llvm::InstCombiner::visitAllocaInst(), and llvm::ObjectSizeOffsetEvaluator::visitAllocaInst().

isStaticAlloca - 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.

Definition at line 914 of file Instructions.cpp.

References llvm::Function::front(), getArraySize(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), and isUsedWithInAlloca().

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.

Definition at line 134 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by clone_impl(), isStaticAlloca(), and WriteInstruction().

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

Definition at line 140 of file Instructions.h.

References llvm::Instruction::getSubclassDataFromInstruction().

Referenced by clone_impl().


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