llvm.org GIT mirror llvm / 03ab7af
Remove dependency on SSARegMap.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5137 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
1 changed file(s) with 22 addition(s) and 27 deletion(s). Raw diff Collapse all Expand all
99 #define LLVM_CODEGEN_MACHINEFUNCTION_H
1010
1111 #include "llvm/CodeGen/MachineBasicBlock.h"
12 #include "llvm/CodeGen/SSARegMap.h"
1312 #include "llvm/Annotation.h"
1413 #include "Support/HashExtras.h"
1514 #include "Support/hash_set"
2120 class Type;
2221 class TargetMachine;
2322 class Pass;
23 class SSARegMap;
2424
2525 Pass *createMachineCodeConstructionPass(TargetMachine &Target);
2626 Pass *createMachineCodeDestructionPass();
3232
3333 // List of machine basic blocks in function
3434 iplist BasicBlocks;
35
36 // Keeping track of mapping from SSA values to registers
37 SSARegMap *SSARegMapping;
3538
3639 // FIXME: State should be held elsewhere...
3740 hash_set constantsForConstPool;
4750 bool spillsAreaFrozen;
4851 bool automaticVarsAreaFrozen;
4952
50 // Keeping track of mapping from SSA values to registers
51 SSARegMap *SSARegMapping;
52
5353 public:
5454 MachineFunction(const Function *Fn, const TargetMachine& target);
55 ~MachineFunction();
5556
5657 /// getFunction - Return the LLVM function that this machine code represents
5758 ///
6970 /// dump - Print the current MachineFunction to cerr, useful for debugger use.
7071 ///
7172 void dump() const;
72
73 /// CalculateArgSize - Call this method to fill in the maxOptionalArgsSize &
74 /// staticStackSize fields...
75 ///
76 void CalculateArgSize();
7773
7874 // The next three methods are used to construct, destruct, and retrieve the
7975 // MachineFunction object for the given method.
8985 static void destruct(const Function *F);
9086 static MachineFunction& get(const Function *F);
9187
92 // Getting and storing SSARegMap information
93 const TargetRegisterClass* getRegClass(unsigned Reg) {
94 return SSARegMapping->getRegClass(Reg);
95 }
96 void addRegMap(unsigned Reg, const TargetRegisterClass *RegClass) {
97 SSARegMapping->addRegMap(Reg, RegClass);
98 }
99 void clearSSARegMap() {
100 delete SSARegMapping;
101 SSARegMapping = NULL;
102 }
103
10488 // Provide accessors for the MachineBasicBlock list...
10589 typedef iplist BasicBlockListType;
10690 typedef BasicBlockListType::iterator iterator;
133117 MachineBasicBlock & back() { return BasicBlocks.back(); }
134118
135119 //===--------------------------------------------------------------------===//
136 //
137 // FIXME: Most of the following state should be moved out to passes that use
138 // it, instead of being put here.
139 //
120 // SSARegMap Interface... Keep track of information about each SSA virtual
121 // register, such as which register class it belongs to.
122 //
123
124 SSARegMap *getSSARegMap() const { return SSARegMapping; }
125 void clearSSARegMap();
126
127
128 //===--------------------------------------------------------------------===//
129 //
130 // FIXME: Most of the following state should be moved into another class!
131 //
132
133 /// CalculateArgSize - Call this method to fill in the maxOptionalArgsSize &
134 /// staticStackSize fields...
135 ///
136 void CalculateArgSize();
140137
141138 //
142139 // Accessors for global information about generated code for a method.
181178
182179 int getOffset (const Value* val) const;
183180
184 // int getOffsetFromFP (const Value* val) const;
185
186181 private:
187182 inline void incrementAutomaticVarsSize(int incr) {
188183 automaticVarsSize+= incr;