[llvm-commits] CVS: llvm/lib/CodeGen/MachineFunction.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Dec 24 23:04:01 PST 2002
Changes in directory llvm/lib/CodeGen:
MachineFunction.cpp updated: 1.31 -> 1.32
---
Log message:
Remove dependency on SSARegMap.h by MachineFunction.h
---
Diffs of the changes:
Index: llvm/lib/CodeGen/MachineFunction.cpp
diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.31 llvm/lib/CodeGen/MachineFunction.cpp:1.32
--- llvm/lib/CodeGen/MachineFunction.cpp:1.31 Sun Dec 15 14:35:25 2002
+++ llvm/lib/CodeGen/MachineFunction.cpp Tue Dec 24 23:03:22 2002
@@ -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 @@
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); }
@@ -152,6 +157,12 @@
assert(mc && "Call construct() method first to allocate the object");
return *mc;
}
+
+void MachineFunction::clearSSARegMap() {
+ delete SSARegMapping;
+ SSARegMapping = 0;
+}
+
static unsigned
ComputeMaxOptionalArgsSize(const TargetMachine& target, const Function *F,
More information about the llvm-commits
mailing list