]> granicus.if.org Git - llvm/commitdiff
Remove dependency on SSARegMap.h by MachineFunction.h
authorChris Lattner <sabre@nondot.org>
Wed, 25 Dec 2002 05:03:22 +0000 (05:03 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 25 Dec 2002 05:03:22 +0000 (05:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5143 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineFunction.cpp

index 8e2616a6211272b8a1dbfeab75a525a96d3ed93e..ef783d1741ffa54b1058270d5ffd14d9c2b89f9e 100644 (file)
@@ -6,9 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/CodeGen/MachineInstr.h"  // For debug output
 #include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/CodeGen/MachineCodeForInstruction.h"
+#include "llvm/CodeGen/SSARegMap.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/MachineFrameInfo.h"
 #include "llvm/Target/MachineCacheInfo.h"
@@ -95,14 +96,18 @@ Pass *createMachineFunctionPrinterPass() {
 
 MachineFunction::MachineFunction(const Function *F,
                                  const TargetMachine& target)
-  : Annotation(MF_AID),
-    Fn(F), Target(target), staticStackSize(0),
-    automaticVarsSize(0), regSpillsSize(0),
-    maxOptionalArgsSize(0), maxOptionalNumArgs(0),
-    currentTmpValuesSize(0), maxTmpValuesSize(0), compiledAsLeaf(false),
-    spillsAreaFrozen(false), automaticVarsAreaFrozen(false)
-{
+  : Annotation(MF_AID), Fn(F), Target(target) {
   SSARegMapping = new SSARegMap();
+
+  // FIXME: move state into another class
+  staticStackSize = automaticVarsSize = regSpillsSize = 0;
+  maxOptionalArgsSize = maxOptionalNumArgs = currentTmpValuesSize = 0;
+  maxTmpValuesSize = 0;
+  compiledAsLeaf = spillsAreaFrozen = automaticVarsAreaFrozen = false;
+}
+
+MachineFunction::~MachineFunction() { 
+  delete SSARegMapping;
 }
 
 void MachineFunction::dump() const { print(std::cerr); }
@@ -153,6 +158,12 @@ MachineFunction& MachineFunction::get(const Function *F)
   return *mc;
 }
 
+void MachineFunction::clearSSARegMap() {
+  delete SSARegMapping;
+  SSARegMapping = 0;
+}
+
+
 static unsigned
 ComputeMaxOptionalArgsSize(const TargetMachine& target, const Function *F,
                            unsigned &maxOptionalNumArgs)