LLVM API Documentation
#include <Instructions.h>
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 Value * | getArraySize () const |
Value * | getArraySize () |
PointerType * | getType () const |
Type * | getAllocatedType () 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 | |
AllocaInst * | clone_impl () const override |
AllocaInst - an instruction to allocate memory on the stack
Definition at line 75 of file Instructions.h.
AllocaInst::AllocaInst | ( | Type * | Ty, |
Value * | ArraySize = nullptr , |
||
const Twine & | Name = "" , |
||
Instruction * | InsertBefore = nullptr |
||
) | [explicit] |
Definition at line 835 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 844 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 853 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 862 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 871 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 880 of file Instructions.cpp.
References llvm::Type::isVoidTy(), setAlignment(), and llvm::Value::setName().
AllocaInst::~AllocaInst | ( | ) | [virtual] |
Definition at line 890 of file Instructions.cpp.
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] |
Implements llvm::Instruction.
Definition at line 3637 of file Instructions.cpp.
References AllocaInst(), getAlignment(), getAllocatedType(), llvm::User::getOperand(), isUsedWithInAlloca(), and setUsedWithInAlloca().
unsigned llvm::AllocaInst::getAlignment | ( | ) | const [inline] |
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(), computeKnownBits(), InlineCallIfPossible(), setAlignment(), llvm::ObjectSizeOffsetVisitor::visitAllocaInst(), llvm::InstCombiner::visitAllocaInst(), and WriteInstruction().
Type * AllocaInst::getAllocatedType | ( | ) | const |
getAllocatedType - Return the type that is being allocated by the instruction.
Definition at line 908 of file Instructions.cpp.
References llvm::SequentialType::getElementType(), and getType().
Referenced by clone_impl(), InlineCallIfPossible(), llvm::InlineFunction(), tryPromoteAllocaToVector(), llvm::ObjectSizeOffsetVisitor::visitAllocaInst(), llvm::InstCombiner::visitAllocaInst(), and llvm::ObjectSizeOffsetEvaluator::visitAllocaInst().
const Value* llvm::AllocaInst::getArraySize | ( | ) | const [inline] |
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().
Value* llvm::AllocaInst::getArraySize | ( | ) | [inline] |
Definition at line 105 of file Instructions.h.
References llvm::User::getOperand().
PointerType* llvm::AllocaInst::getType | ( | ) | const [inline] |
getType - Overload to return most specific pointer type
Reimplemented from llvm::Value.
Definition at line 109 of file Instructions.h.
Referenced by computeKnownBits(), getAllocatedType(), hasLifetimeMarkers(), llvm::isAllocaPromotable(), isArray(), llvm::Interpreter::visitAllocaInst(), and llvm::InstCombiner::visitAllocaInst().
bool AllocaInst::isArrayAllocation | ( | ) | const |
isArrayAllocation - Return true if there is an allocation size parameter to the allocation instruction that is not 1.
Definition at line 902 of file Instructions.cpp.
References llvm::User::getOperand().
Referenced by InlineCallIfPossible(), isArray(), llvm::ObjectSizeOffsetVisitor::visitAllocaInst(), llvm::InstCombiner::visitAllocaInst(), and llvm::ObjectSizeOffsetEvaluator::visitAllocaInst().
bool AllocaInst::isStaticAlloca | ( | ) | const |
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 915 of file Instructions.cpp.
References llvm::Function::front(), getArraySize(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), and isUsedWithInAlloca().
bool llvm::AllocaInst::isUsedWithInAlloca | ( | ) | const [inline] |
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().
void AllocaInst::setAlignment | ( | unsigned | Align | ) |
Definition at line 893 of file Instructions.cpp.
References getAlignment(), llvm::Instruction::getSubclassDataFromInstruction(), and llvm::Log2_32().
Referenced by AllocaInst(), InlineCallIfPossible(), and llvm::InstCombiner::visitAllocaInst().
void llvm::AllocaInst::setUsedWithInAlloca | ( | bool | V | ) | [inline] |
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().