diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-02-15 00:03:15 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-02-15 00:03:15 +0000 |
commit | c81efdc59cd2ce5410cefd7ab5cb52cfd7ac3aad (patch) | |
tree | db2d8e0c8eaf7144ff25aa608d4cac1bc59eab40 /lib/CodeGen/MachineFunction.cpp | |
parent | b663d76f866d03756dd563d246d9bdaabca4ca33 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11453 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | lib/CodeGen/MachineFunction.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index 645e7cfedf..719d28a0a8 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/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 //===---------------------------------------------------------------------===// |