aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-07-21 18:38:57 +0000
committerChris Lattner <sabre@nondot.org>2009-07-21 18:38:57 +0000
commit40bbebde9d250b875a47a688d0c6552834ada48f (patch)
treed754be08833dd4af5a831902a23617737d4b98aa /lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
parent4b938958bcc59586508bc9681e75c2e3f5164672 (diff)
make AsmPrinter::doFinalization iterate over the global variables
and call PrintGlobalVariable, allowing elimination and simplification of various targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76604 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp')
-rw-r--r--lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
index 59e5c6e645..a447503696 100644
--- a/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
+++ b/lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
@@ -282,8 +282,6 @@ namespace {
}
virtual bool runOnMachineFunction(MachineFunction &F) = 0;
- //! Assembly printer cleanup after function has been emitted
- virtual bool doFinalization(Module &M) = 0;
};
/// LinuxAsmPrinter - SPU assembly printer, customized for Linux
@@ -300,8 +298,6 @@ namespace {
bool runOnMachineFunction(MachineFunction &F);
bool doInitialization(Module &M);
- //! Dump globals, perform cleanup after function emission
- bool doFinalization(Module &M);
void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
@@ -311,7 +307,7 @@ namespace {
}
//! Emit a global variable according to its section and type
- void printModuleLevelGV(const GlobalVariable* GVar);
+ void PrintGlobalVariable(const GlobalVariable* GVar);
};
} // end of anonymous namespace
@@ -507,7 +503,7 @@ static void PrintUnmangledNameSafely(const Value *V, formatted_raw_ostream &OS)
\note This code was shamelessly copied from the PowerPC's assembly printer,
which sort of screams for some kind of refactorization of common code.
*/
-void LinuxAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
+void LinuxAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) {
const TargetData *TD = TM.getTargetData();
if (!GVar->hasInitializer())
@@ -588,15 +584,6 @@ void LinuxAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
O << '\n';
}
-bool LinuxAsmPrinter::doFinalization(Module &M) {
- // Print out module-level global variables here.
- for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
- I != E; ++I)
- printModuleLevelGV(I);
-
- return AsmPrinter::doFinalization(M);
-}
-
/// createSPUCodePrinterPass - Returns a pass that prints the Cell SPU
/// assembly code for a MachineFunction to the given output stream, in a format
/// that the Linux SPU assembler can deal with.