diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-01-04 22:28:25 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-01-04 22:28:25 +0000 |
commit | b2efb853f00d45b1c8d57f92acd0028fbdeffda6 (patch) | |
tree | b5563153d7d0593950bc90ea1253acb1d787c556 /lib/Target/PowerPC/PPCAsmPrinter.cpp | |
parent | 62281a132f11e742a96ff9caeaaaa17900020acd (diff) |
Applied some recommend changes from sabre. The dominate one beginning "let the
pass manager do it's thing." Fixes crash when compiling -g files and suppresses
dwarf statements if no debug info is present.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCAsmPrinter.cpp')
-rw-r--r-- | lib/Target/PowerPC/PPCAsmPrinter.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index 12b5f44775..abbe95a852 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -204,16 +204,16 @@ namespace { virtual bool runOnMachineFunction(MachineFunction &F) = 0; virtual bool doFinalization(Module &M) = 0; + }; /// DarwinDwarfWriter - Dwarf debug info writer customized for Darwin/Mac OS X /// struct DarwinDwarfWriter : public DwarfWriter { // Ctor. - DarwinDwarfWriter(std::ostream &o, AsmPrinter *ap, MachineDebugInfo &di) - : DwarfWriter(o, ap, di) + DarwinDwarfWriter(std::ostream &o, AsmPrinter *ap) + : DwarfWriter(o, ap) { - hasLEB128 = false; needsSet = true; DwarfAbbrevSection = ".section __DWARFA,__debug_abbrev,regular,debug"; DwarfInfoSection = ".section __DWARFA,__debug_info,regular,debug"; @@ -229,9 +229,7 @@ namespace { DarwinDwarfWriter DW; DarwinAsmPrinter(std::ostream &O, TargetMachine &TM) - : PPCAsmPrinter(O, TM), - // FIXME - MachineDebugInfo needs a proper location - DW(O, this, getMachineDebugInfo()) + : PPCAsmPrinter(O, TM), DW(O, this) { CommentString = ";"; GlobalPrefix = "_"; @@ -252,6 +250,11 @@ namespace { bool runOnMachineFunction(MachineFunction &F); bool doInitialization(Module &M); bool doFinalization(Module &M); + + void getAnalysisUsage(AnalysisUsage &AU) const { + AU.addRequired<MachineDebugInfo>(); + } + }; /// AIXAsmPrinter - PowerPC assembly printer, customized for AIX @@ -483,6 +486,7 @@ bool DarwinAsmPrinter::doInitialization(Module &M) { Mang->setUseQuotes(true); // Emit initial debug information. + DW.SetDebugInfo(getAnalysisToUpdate<MachineDebugInfo>()); DW.BeginModule(); return false; } @@ -613,7 +617,7 @@ bool DarwinAsmPrinter::doFinalization(Module &M) { return false; // success } -/// runOnMachineFunction - This uses the printMachineInstruction() +/// runOnMachineFunction - This uses the e() /// method to print assembly for each instruction. /// bool AIXAsmPrinter::runOnMachineFunction(MachineFunction &MF) { |