summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-15 00:03:15 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-15 00:03:15 +0000
commit6a35516dccb6f284a22801530121391d4a3a10fa (patch)
treea37afbfeeda615ea8897a272a38868220806ccca /llvm/lib/CodeGen/MachineFunction.cpp
parentfccb75d91ee4dd9c34ba56a1279c5f5501306a32 (diff)
downloadbcm5719-llvm-6a35516dccb6f284a22801530121391d4a3a10fa.tar.gz
bcm5719-llvm-6a35516dccb6f284a22801530121391d4a3a10fa.zip
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. llvm-svn: 11453
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index 645e7cfedfe..719d28a0a85 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -62,6 +62,27 @@ FunctionPass *llvm::createMachineFunctionPrinterPass(std::ostream *OS,
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
//===---------------------------------------------------------------------===//
OpenPOWER on IntegriCloud