forked from OSchip/llvm-project
Add BasicBlock list to MchineFunction that will eventually be the only
way to access MachineBasicBlocks. For now, it is never filled. llvm-svn: 4324
This commit is contained in:
parent
2a3bd1c562
commit
defd415d01
|
@ -11,11 +11,13 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
class BasicBlock;
|
class BasicBlock;
|
||||||
class MachineInstr;
|
class MachineInstr;
|
||||||
|
template <typename T> struct ilist_traits;
|
||||||
|
|
||||||
extern AnnotationID MCFBB_AID;
|
extern AnnotationID MCFBB_AID;
|
||||||
|
|
||||||
class MachineBasicBlock : public Annotation {
|
class MachineBasicBlock : public Annotation {
|
||||||
std::vector<MachineInstr*> Insts;
|
std::vector<MachineInstr*> Insts;
|
||||||
|
MachineBasicBlock *Prev, *Next;
|
||||||
public:
|
public:
|
||||||
MachineBasicBlock() : Annotation(MCFBB_AID) {}
|
MachineBasicBlock() : Annotation(MCFBB_AID) {}
|
||||||
~MachineBasicBlock() {}
|
~MachineBasicBlock() {}
|
||||||
|
@ -70,6 +72,14 @@ public:
|
||||||
Insts.pop_back();
|
Insts.pop_back();
|
||||||
return R;
|
return R;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private: // Methods used to maintain doubly linked list of blocks...
|
||||||
|
friend class ilist_traits<MachineBasicBlock>;
|
||||||
|
|
||||||
|
MachineBasicBlock *getPrev() const { return Prev; }
|
||||||
|
MachineBasicBlock *getNext() const { return Next; }
|
||||||
|
void setPrev(MachineBasicBlock *P) { Prev = P; }
|
||||||
|
void setNext(MachineBasicBlock *N) { Next = N; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
#include "llvm/CodeGen/MachineBasicBlock.h"
|
#include "llvm/CodeGen/MachineBasicBlock.h"
|
||||||
#include "Support/NonCopyable.h"
|
#include "Support/NonCopyable.h"
|
||||||
#include "Support/HashExtras.h"
|
#include "Support/HashExtras.h"
|
||||||
#include <Support/hash_set>
|
#include "Support/hash_set"
|
||||||
|
#include "Support/ilist"
|
||||||
|
|
||||||
class Value;
|
class Value;
|
||||||
class Function;
|
class Function;
|
||||||
class Constant;
|
class Constant;
|
||||||
|
@ -24,11 +26,14 @@ Pass *createMachineCodeConstructionPass(TargetMachine &Target);
|
||||||
Pass *createMachineCodeDestructionPass();
|
Pass *createMachineCodeDestructionPass();
|
||||||
|
|
||||||
class MachineFunction : private Annotation {
|
class MachineFunction : private Annotation {
|
||||||
hash_set<const Constant*> constantsForConstPool;
|
|
||||||
hash_map<const Value*, int> offsets;
|
|
||||||
const Function *method;
|
const Function *method;
|
||||||
|
|
||||||
|
// List of machine basic blocks in function
|
||||||
|
iplist<MachineBasicBlock> BasicBlocks;
|
||||||
|
|
||||||
// FIXME: State should be held elsewhere...
|
// FIXME: State should be held elsewhere...
|
||||||
|
hash_set<const Constant*> constantsForConstPool;
|
||||||
|
hash_map<const Value*, int> offsets;
|
||||||
unsigned staticStackSize;
|
unsigned staticStackSize;
|
||||||
unsigned automaticVarsSize;
|
unsigned automaticVarsSize;
|
||||||
unsigned regSpillsSize;
|
unsigned regSpillsSize;
|
||||||
|
|
Loading…
Reference in New Issue