diff options
author | Chris Lattner <sabre@nondot.org> | 2002-10-28 02:08:43 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-10-28 02:08:43 +0000 |
commit | defd415d01f596c1da2211323e9620ed5bd92638 (patch) | |
tree | 68267ab41f282c2fa8788e3b154fc3c5c03e58b5 /llvm/include | |
parent | 2a3bd1c562a8b2961bec76e252a682234b0f504d (diff) | |
download | bcm5719-llvm-defd415d01f596c1da2211323e9620ed5bd92638.tar.gz bcm5719-llvm-defd415d01f596c1da2211323e9620ed5bd92638.zip |
Add BasicBlock list to MchineFunction that will eventually be the only
way to access MachineBasicBlocks. For now, it is never filled.
llvm-svn: 4324
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/CodeGen/MachineBasicBlock.h | 10 | ||||
-rw-r--r-- | llvm/include/llvm/CodeGen/MachineFunction.h | 13 |
2 files changed, 19 insertions, 4 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineBasicBlock.h b/llvm/include/llvm/CodeGen/MachineBasicBlock.h index 2b1064dca57..aa32a811098 100644 --- a/llvm/include/llvm/CodeGen/MachineBasicBlock.h +++ b/llvm/include/llvm/CodeGen/MachineBasicBlock.h @@ -11,11 +11,13 @@ #include <vector> class BasicBlock; class MachineInstr; +template <typename T> struct ilist_traits; extern AnnotationID MCFBB_AID; class MachineBasicBlock : public Annotation { std::vector<MachineInstr*> Insts; + MachineBasicBlock *Prev, *Next; public: MachineBasicBlock() : Annotation(MCFBB_AID) {} ~MachineBasicBlock() {} @@ -70,6 +72,14 @@ public: Insts.pop_back(); 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; } }; diff --git a/llvm/include/llvm/CodeGen/MachineFunction.h b/llvm/include/llvm/CodeGen/MachineFunction.h index 64cd4b56618..131b0359f76 100644 --- a/llvm/include/llvm/CodeGen/MachineFunction.h +++ b/llvm/include/llvm/CodeGen/MachineFunction.h @@ -12,7 +12,9 @@ #include "llvm/CodeGen/MachineBasicBlock.h" #include "Support/NonCopyable.h" #include "Support/HashExtras.h" -#include <Support/hash_set> +#include "Support/hash_set" +#include "Support/ilist" + class Value; class Function; class Constant; @@ -24,11 +26,14 @@ Pass *createMachineCodeConstructionPass(TargetMachine &Target); Pass *createMachineCodeDestructionPass(); 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... + hash_set<const Constant*> constantsForConstPool; + hash_map<const Value*, int> offsets; unsigned staticStackSize; unsigned automaticVarsSize; unsigned regSpillsSize; |