diff options
author | Chris Lattner <sabre@nondot.org> | 2009-07-21 18:38:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-07-21 18:38:57 +0000 |
commit | 40bbebde9d250b875a47a688d0c6552834ada48f (patch) | |
tree | d754be08833dd4af5a831902a23617737d4b98aa /lib/Target/XCore | |
parent | 4b938958bcc59586508bc9681e75c2e3f5164672 (diff) | |
download | external_llvm-40bbebde9d250b875a47a688d0c6552834ada48f.zip external_llvm-40bbebde9d250b875a47a688d0c6552834ada48f.tar.gz external_llvm-40bbebde9d250b875a47a688d0c6552834ada48f.tar.bz2 |
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/XCore')
-rw-r--r-- | lib/Target/XCore/XCoreAsmPrinter.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/Target/XCore/XCoreAsmPrinter.cpp b/lib/Target/XCore/XCoreAsmPrinter.cpp index 433e06c..2a4d57b 100644 --- a/lib/Target/XCore/XCoreAsmPrinter.cpp +++ b/lib/Target/XCore/XCoreAsmPrinter.cpp @@ -70,7 +70,7 @@ namespace { void emitExternDirective(const std::string &name); void emitArrayBound(const std::string &name, const GlobalVariable *GV); - void emitGlobal(const GlobalVariable *GV); + virtual void PrintGlobalVariable(const GlobalVariable *GV); void emitFunctionStart(MachineFunction &MF); void emitFunctionEnd(MachineFunction &MF); @@ -79,7 +79,6 @@ namespace { void printMachineInstruction(const MachineInstr *MI); bool runOnMachineFunction(MachineFunction &F); bool doInitialization(Module &M); - bool doFinalization(Module &M); void getAnalysisUsage(AnalysisUsage &AU) const { AsmPrinter::getAnalysisUsage(AU); @@ -136,7 +135,7 @@ emitArrayBound(const std::string &name, const GlobalVariable *GV) } } -void XCoreAsmPrinter::emitGlobal(const GlobalVariable *GV) { +void XCoreAsmPrinter::PrintGlobalVariable(const GlobalVariable *GV) { // Check to see if this is a special global used by LLVM, if so, emit it. if (!GV->hasInitializer() || EmitSpecialLLVMGlobal(GV)) @@ -387,13 +386,4 @@ bool XCoreAsmPrinter::doInitialization(Module &M) { return Result; } -bool XCoreAsmPrinter::doFinalization(Module &M) { - // Print out module-level global variables. - for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); - I != E; ++I) { - emitGlobal(I); - } - - return AsmPrinter::doFinalization(M); -} |