From 6a35516dccb6f284a22801530121391d4a3a10fa Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Sun, 15 Feb 2004 00:03:15 +0000 Subject: 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 --- llvm/lib/CodeGen/MachineFunction.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'llvm/lib/CodeGen/MachineFunction.cpp') 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 //===---------------------------------------------------------------------===// -- cgit v1.2.3