18 #ifndef LLVM_CODEGEN_MACHINEFUNCTION_H
19 #define LLVM_CODEGEN_MACHINEFUNCTION_H
33 class MachineRegisterInfo;
34 class MachineFrameInfo;
35 class MachineConstantPool;
36 class MachineJumpTableInfo;
37 class MachineModuleInfo;
41 class TargetRegisterClass;
42 struct MachinePointerInfo;
101 std::vector<MachineBasicBlock*> MBBNumbering;
122 unsigned FunctionNumber;
132 bool ExposesReturnsTwice;
205 if (Alignment < A) Alignment =
A;
212 return ExposesReturnsTwice;
218 ExposesReturnsTwice = B;
223 return HasMSInlineAsm;
235 template<
typename Ty>
240 Ty *Loc =
static_cast<Ty*
>(Allocator.
Allocate(
sizeof(Ty),
242 MFInfo =
new (Loc) Ty(*
this);
244 return static_cast<Ty*
>(MFInfo);
247 template<
typename Ty>
258 assert(N < MBBNumbering.size() &&
"Illegal block number");
259 assert(MBBNumbering[N] &&
"Block was removed from the machine function!");
260 return MBBNumbering[
N];
300 void verify(
Pass *p = NULL,
const char *Banner = NULL)
const;
325 unsigned size()
const {
return (
unsigned)BasicBlocks.
size();}
335 BasicBlocks.
insert(MBBI, MBB);
338 BasicBlocks.
splice(InsertPt, BasicBlocks, MBBI);
341 BasicBlocks.
splice(InsertPt, BasicBlocks, MBBI, MBBE);
348 BasicBlocks.
erase(MBBI);
359 MBBNumbering.push_back(MBB);
360 return (
unsigned)MBBNumbering.size()-1;
367 assert(N < MBBNumbering.size() &&
"Illegal basic block #");
403 unsigned f, uint64_t s,
404 unsigned base_alignment,
405 const MDNode *TBAAInfo = 0,
406 const MDNode *Ranges = 0);
413 int64_t Offset, uint64_t Size);
420 return OperandRecycler.
allocate(Cap, Allocator);
456 bool isLinkerPrivate =
false)
const;
void push_front(MachineBasicBlock *MBB)
The machine constant pool.
unsigned getAlignment() const
static NodeType * getEntryNode(Inverse< MachineFunction * > G)
MachineInstr * CreateMachineInstr(const MCInstrDesc &MCID, DebugLoc DL, bool NoImp=false)
void removeNodeFromList(NodeTy *)
iplist< MachineBasicBlock >::iterator iterator
static NodeTy * createNode(const NodeTy &V)
T * allocate(Capacity Cap, AllocatorType &Allocator)
static void noteHead(MachineBasicBlock *, MachineBasicBlock *)
std::reverse_iterator< iterator > reverse_iterator
void verify(Pass *p=NULL, const char *Banner=NULL) const
void print(raw_ostream &OS, SlotIndexes *=0) const
static nodes_iterator nodes_end(MachineFunction *F)
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, unsigned f, uint64_t s, unsigned base_alignment, const MDNode *TBAAInfo=0, const MDNode *Ranges=0)
unsigned addLiveIn(unsigned PReg, const TargetRegisterClass *RC)
static NodeType * getEntryNode(Inverse< const MachineFunction * > G)
ArrayRecycler< MachineOperand >::Capacity OperandCapacity
MDNode - a tuple of other values.
const Function * getFunction() const
unsigned getFunctionNumber() const
static nodes_iterator nodes_begin(const MachineFunction *F)
void DeleteMachineBasicBlock(MachineBasicBlock *MBB)
void destroySentinel(MachineBasicBlock *) const
MachineJumpTableInfo * getOrCreateJumpTableInfo(unsigned JTEntryKind)
reverse_iterator rbegin()
static nodes_iterator nodes_begin(MachineFunction *F)
unsigned getNumBlockIDs() const
MachineJumpTableInfo * getJumpTableInfo()
const_reverse_iterator rend() const
void push_front(const NodeTy &val)
MachineMemOperand ** mmo_iterator
Abstract Stack Frame Information.
std::pair< MachineInstr::mmo_iterator, MachineInstr::mmo_iterator > extractLoadMemRefs(MachineInstr::mmo_iterator Begin, MachineInstr::mmo_iterator End)
MachineBasicBlock * provideInitialHead() const
const MachineBasicBlock & front() const
MachineBasicBlock * ensureHead(MachineBasicBlock *) const
void RenumberBlocks(MachineBasicBlock *MBBFrom=0)
const MachineJumpTableInfo * getJumpTableInfo() const
MachineFunction::const_iterator nodes_iterator
MCContext & getContext() const
const MachineRegisterInfo & getRegInfo() const
MachineBasicBlock * createSentinel() const
const MachineFrameInfo * getFrameInfo() const
MachineBasicBlock * CreateMachineBasicBlock(const BasicBlock *bb=0)
LLVM Basic Block Representation.
size_type LLVM_ATTRIBUTE_UNUSED_RESULT size() const
GCModuleInfo * getGMI() const
void ensureAlignment(unsigned A)
ensureAlignment - Make sure the function is at least 1 << A bytes aligned.
iterator insert(iterator where, const NodeTy &val)
virtual ~MachineFunctionInfo()
void splice(iterator InsertPt, iterator MBBI, iterator MBBE)
MachineConstantPool * getConstantPool()
static NodeType * getEntryNode(const MachineFunction *F)
void DeleteMachineInstr(MachineInstr *MI)
MachineFunction::iterator nodes_iterator
MachineBasicBlock & back()
iterator erase(iterator where)
MCSymbol * getPICBaseSymbol() const
BasicBlockListType::const_iterator const_iterator
void splice(iterator InsertPt, iterator MBBI)
MachineInstr * CloneMachineInstr(const MachineInstr *Orig)
MachineBasicBlock * getBlockNumbered(unsigned N) const
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
const_iterator end() const
MachineFrameInfo * getFrameInfo()
const MachineConstantPool * getConstantPool() const
void splice(iterator where, iplist &L2)
#define LLVM_DELETED_FUNCTION
ilist_half_node< MachineBasicBlock > Sentinel
MCSymbol * getJTISymbol(unsigned JTI, MCContext &Ctx, bool isLinkerPrivate=false) const
static void deleteNode(NodeTy *V)
void * Allocate(size_t Size, size_t Alignment)
static unsigned size(MachineFunction *F)
std::reverse_iterator< const_iterator > const_reverse_iterator
static NodeType * getEntryNode(MachineFunction *F)
static unsigned size(const MachineFunction *F)
void addNodeToList(NodeTy *)
MachineRegisterInfo & getRegInfo()
bool exposesReturnsTwice() const
bool hasMSInlineAsm() const
Returns true if the function contains any MS-style inline assembly.
const TargetMachine & getTarget() const
MachineBasicBlock & front()
void setExposesReturnsTwice(bool B)
void removeFromMBBNumbering(unsigned N)
static NodeTy * createSentinel()
createSentinel - create the dynamic sentinel
const Ty * getInfo() const
std::pair< MachineInstr::mmo_iterator, MachineInstr::mmo_iterator > extractStoreMemRefs(MachineInstr::mmo_iterator Begin, MachineInstr::mmo_iterator End)
void erase(iterator MBBI)
void insert(iterator MBBI, MachineBasicBlock *MBB)
static nodes_iterator nodes_end(const MachineFunction *F)
unsigned addToMBBNumbering(MachineBasicBlock *MBB)
Adds the MBB to the internal numbering. Returns the unique number assigned to the MBB...
void deallocateOperandArray(OperandCapacity Cap, MachineOperand *Array)
void push_back(MachineBasicBlock *MBB)
void setAlignment(unsigned A)
BasicBlockListType::iterator iterator
const MachineBasicBlock & back() const
const_reverse_iterator rbegin() const
void deallocate(Capacity Cap, T *Ptr)
MachineModuleInfo & getMMI() const
StringRef getName() const
const_iterator begin() const
void setHasMSInlineAsm(bool B)
reverse_iterator rbegin()
NodeTy * remove(iterator &IT)
MachineInstr::mmo_iterator allocateMemRefsArray(unsigned long Num)
MachineOperand * allocateOperandArray(OperandCapacity Cap)
void push_back(const NodeTy &val)