LLVM API Documentation

llvm::AllocationInst Class Reference

#include <Instructions.h>

Inheritance diagram for llvm::AllocationInst:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual ~AllocationInst ()
bool isArrayAllocation () const
const ValuegetArraySize () const
ValuegetArraySize ()
const PointerTypegetType () const
const TypegetAllocatedType () const
unsigned getAlignment () const
void setAlignment (unsigned Align)
virtual Instructionclone () const=0

Static Public Member Functions

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

Protected Member Functions

 AllocationInst (const Type *Ty, Value *ArraySize, unsigned iTy, unsigned Align, const std::string &Name="", Instruction *InsertBefore=0)
 AllocationInst (const Type *Ty, Value *ArraySize, unsigned iTy, unsigned Align, const std::string &Name, BasicBlock *InsertAtEnd)

Detailed Description

AllocationInst - This class is the common base class of MallocInst and AllocaInst.

Definition at line 36 of file Instructions.h.


Constructor & Destructor Documentation

AllocationInst::AllocationInst ( const Type Ty,
Value ArraySize,
unsigned  iTy,
unsigned  Align,
const std::string &  Name = "",
Instruction InsertBefore = 0 
) [protected]

Definition at line 526 of file Instructions.cpp.

References llvm::Type::VoidTy.

AllocationInst::AllocationInst ( const Type Ty,
Value ArraySize,
unsigned  iTy,
unsigned  Align,
const std::string &  Name,
BasicBlock InsertAtEnd 
) [protected]

Definition at line 535 of file Instructions.cpp.

References llvm::Type::VoidTy.

AllocationInst::~AllocationInst (  )  [virtual]

Definition at line 545 of file Instructions.cpp.


Member Function Documentation

bool AllocationInst::isArrayAllocation (  )  const

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

Definition at line 548 of file Instructions.cpp.

References llvm::UnaryInstruction::getOperand().

Referenced by EvaluateFunction().

const Value* llvm::AllocationInst::getArraySize (  )  const [inline]

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

Definition at line 55 of file Instructions.h.

References llvm::UnaryInstruction::getOperand().

Referenced by CheckForEscapingAllocas(), llvm::CloneBasicBlock(), llvm::InlineFunction(), and llvm::SelectionDAGLowering::visitAlloca().

Value* llvm::AllocationInst::getArraySize (  )  [inline]

Definition at line 56 of file Instructions.h.

References llvm::UnaryInstruction::getOperand().

const PointerType* llvm::AllocationInst::getType (  )  const [inline]

getType - Overload to return most specific pointer type

Reimplemented from llvm::Value.

Definition at line 60 of file Instructions.h.

References llvm::Value::getType().

Referenced by llvm::DSGraph::AssertGraphOK(), EvaluateFunction(), getAllocatedType(), llvm::DSGraph::getFunctionArgumentsForCall(), llvm::Interpreter::visitAllocationInst(), and llvm::SelectionDAGLowering::visitMalloc().

const Type * AllocationInst::getAllocatedType (  )  const

getAllocatedType - Return the type that is being allocated by the instruction.

Definition at line 554 of file Instructions.cpp.

References llvm::SequentialType::getElementType(), and getType().

Referenced by llvm::SelectionDAGLowering::visitAlloca().

unsigned llvm::AllocationInst::getAlignment (  )  const [inline]

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

Definition at line 72 of file Instructions.h.

Referenced by llvm::SelectionDAGLowering::visitAlloca().

void llvm::AllocationInst::setAlignment ( unsigned  Align  )  [inline]

Definition at line 73 of file Instructions.h.

virtual Instruction* llvm::AllocationInst::clone (  )  const [pure virtual]

clone() - Create a copy of 'this' instruction that is identical in all ways except the following: The instruction has no parent The instruction has no name

Implements llvm::Instruction.

Implemented in llvm::MallocInst, and llvm::AllocaInst.

static bool llvm::AllocationInst::classof ( const AllocationInst  )  [inline, static]

Definition at line 81 of file Instructions.h.

Referenced by classof().

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

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

Reimplemented from llvm::Instruction.

Reimplemented in llvm::MallocInst, and llvm::AllocaInst.

Definition at line 82 of file Instructions.h.

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

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

Reimplemented from llvm::Instruction.

Reimplemented in llvm::MallocInst, and llvm::AllocaInst.

Definition at line 86 of file Instructions.h.

References classof(), and V.


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