diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-02-12 02:27:10 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-02-12 02:27:10 +0000 |
commit | c0b9dc5be79f009d260edb5cd5e1d8346587aaa2 (patch) | |
tree | f68d35cea961a4c0fdb0c5bd9f943e77c5f34161 /lib/CodeGen/MachineFunction.cpp | |
parent | 918cdd420b52a4745ce7d4495759c87fd1b32fd5 (diff) |
Change MachineBasicBlock's vector of MachineInstr pointers into an
ilist of MachineInstr objects. This allows constant time removal and
insertion of MachineInstr instances from anywhere in each
MachineBasicBlock. It also allows for constant time splicing of
MachineInstrs into or out of MachineBasicBlocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11340 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineFunction.cpp')
-rw-r--r-- | lib/CodeGen/MachineFunction.cpp | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/lib/CodeGen/MachineFunction.cpp b/lib/CodeGen/MachineFunction.cpp index 6c15ad5c4d..4de55f4596 100644 --- a/lib/CodeGen/MachineFunction.cpp +++ b/lib/CodeGen/MachineFunction.cpp @@ -62,34 +62,6 @@ 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 all of the MachineInstrs out of the function. When the sparc - // backend gets fixed, this can be dramatically simpler, but actually - // putting this stuff into the MachineBasicBlock destructor! - for (MachineFunction::iterator BB = MF.begin(), E = MF.end(); BB != E; - ++BB) - while (!BB->empty()) - delete BB->pop_back(); - - // 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 //===---------------------------------------------------------------------===// @@ -127,7 +99,7 @@ void MachineFunction::print(std::ostream &OS) const { OS << "\n" << LBB->getName() << " (" << (const void*)LBB << "):\n"; for (MachineBasicBlock::const_iterator I = BB->begin(); I != BB->end();++I){ OS << "\t"; - (*I)->print(OS, Target); + I->print(OS, Target); } } OS << "\nEnd function \"" << Fn->getName() << "\"\n\n"; |