summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-28 02:08:43 +0000
committerChris Lattner <sabre@nondot.org>2002-10-28 02:08:43 +0000
commit8e7ae9860bd1f29c95e4e10fe151a22aaafafef9 (patch)
treedd867ae4501daffe60ef03bad06dd7ed843bde68 /include
parente61a584f98b1133ca1b8e3b411a3c6fb892542e4 (diff)
downloadllvm-8e7ae9860bd1f29c95e4e10fe151a22aaafafef9.tar.gz
llvm-8e7ae9860bd1f29c95e4e10fe151a22aaafafef9.tar.bz2
llvm-8e7ae9860bd1f29c95e4e10fe151a22aaafafef9.tar.xz
Add BasicBlock list to MchineFunction that will eventually be the only
way to access MachineBasicBlocks. For now, it is never filled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4324 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/MachineBasicBlock.h10
-rw-r--r--include/llvm/CodeGen/MachineFunction.h13
2 files changed, 19 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/MachineBasicBlock.h b/include/llvm/CodeGen/MachineBasicBlock.h
index 2b1064dca5..aa32a81109 100644
--- a/include/llvm/CodeGen/MachineBasicBlock.h
+++ b/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/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h
index 64cd4b5661..131b0359f7 100644
--- a/include/llvm/CodeGen/MachineFunction.h
+++ b/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;