[llvm-commits] CVS: llvm/lib/CodeGen/MachineFunction.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Sat Feb 14 18:04:15 PST 2004


Changes in directory llvm/lib/CodeGen:

MachineFunction.cpp updated: 1.50 -> 1.51

---
Log message:

Add back machine code deleter pass until we get a MachineCode pass
that will be responsible for the creation of MachineFunctions and will
be required by all MachineFunctionPass passes.


---
Diffs of the changes:  (+21 -0)

Index: llvm/lib/CodeGen/MachineFunction.cpp
diff -u llvm/lib/CodeGen/MachineFunction.cpp:1.50 llvm/lib/CodeGen/MachineFunction.cpp:1.51
--- llvm/lib/CodeGen/MachineFunction.cpp:1.50	Thu Feb 12 22:39:55 2004
+++ llvm/lib/CodeGen/MachineFunction.cpp	Sat Feb 14 18:03:15 2004
@@ -62,6 +62,27 @@
   return new Printer(OS, Banner);
 }
 
+namespace {
+  struct Deleter : public MachineFunctionPass {
+    const char *getPassName() const { return "Machine Code Deleter"; }
+
+    bool runOnMachineFunction(MachineFunction &MF) {
+      // Delete the annotation from the function now.
+      MachineFunction::destruct(MF.getFunction());
+      return true;
+    }
+  };
+}
+
+/// MachineCodeDeletion Pass - This pass deletes all of the machine code for
+/// the current function, which should happen after the function has been
+/// emitted to a .s file or to memory.
+FunctionPass *llvm::createMachineCodeDeleter() {
+  return new Deleter();
+}
+
+
+
 //===---------------------------------------------------------------------===//
 // MachineFunction implementation
 //===---------------------------------------------------------------------===//





More information about the llvm-commits mailing list