diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2006-03-07 02:02:57 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2006-03-07 02:02:57 +0000 |
| commit | 30d7b70b735059f14a5342e4c6c3c6f3ab73672e (patch) | |
| tree | 204ed5bc67503f5a4f778ef3b0b4bd5655b132c1 /llvm/lib/Target/X86/X86AsmPrinter.h | |
| parent | 53ef5a032cdfb6cf3fc3b24abfc6a71d8ee57229 (diff) | |
| download | bcm5719-llvm-30d7b70b735059f14a5342e4c6c3c6f3ab73672e.tar.gz bcm5719-llvm-30d7b70b735059f14a5342e4c6c3c6f3ab73672e.zip | |
Enable Dwarf debugging info.
llvm-svn: 26581
Diffstat (limited to 'llvm/lib/Target/X86/X86AsmPrinter.h')
| -rwxr-xr-x | llvm/lib/Target/X86/X86AsmPrinter.h | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86AsmPrinter.h b/llvm/lib/Target/X86/X86AsmPrinter.h index b27cdf067d4..5b27c564577 100755 --- a/llvm/lib/Target/X86/X86AsmPrinter.h +++ b/llvm/lib/Target/X86/X86AsmPrinter.h @@ -18,6 +18,8 @@ #include "X86.h" #include "llvm/CodeGen/AsmPrinter.h" +#include "llvm/CodeGen/DwarfWriter.h" +#include "llvm/CodeGen/MachineDebugInfo.h" #include "llvm/ADT/Statistic.h" #include <set> @@ -27,14 +29,46 @@ namespace x86 { extern Statistic<> EmittedInsts; +/// X86DwarfWriter - Dwarf debug info writer customized for Darwin/Mac OS X +/// +struct X86DwarfWriter : public DwarfWriter { + // Ctor. +X86DwarfWriter(std::ostream &o, AsmPrinter *ap) + : DwarfWriter(o, ap) + { + needsSet = true; + DwarfAbbrevSection = ".section __DWARFA,__debug_abbrev"; + DwarfInfoSection = ".section __DWARFA,__debug_info"; + DwarfLineSection = ".section __DWARFA,__debug_line"; + DwarfFrameSection = ".section __DWARFA,__debug_frame"; + DwarfPubNamesSection = ".section __DWARFA,__debug_pubnames"; + DwarfPubTypesSection = ".section __DWARFA,__debug_pubtypes"; + DwarfStrSection = ".section __DWARFA,__debug_str"; + DwarfLocSection = ".section __DWARFA,__debug_loc"; + DwarfARangesSection = ".section __DWARFA,__debug_aranges"; + DwarfRangesSection = ".section __DWARFA,__debug_ranges"; + DwarfMacInfoSection = ".section __DWARFA,__debug_macinfo"; + TextSection = ".text"; + DataSection = ".data"; + } +}; + struct X86SharedAsmPrinter : public AsmPrinter { + X86DwarfWriter DW; + X86SharedAsmPrinter(std::ostream &O, TargetMachine &TM) - : AsmPrinter(O, TM), forDarwin(false) { } + : AsmPrinter(O, TM), DW(O, this), forDarwin(false) { } bool doInitialization(Module &M); bool doFinalization(Module &M); - bool forDarwin; // FIXME: eliminate. + void getAnalysisUsage(AnalysisUsage &AU) const { + AU.setPreservesAll(); + AU.addRequired<MachineDebugInfo>(); + MachineFunctionPass::getAnalysisUsage(AU); + } + + bool forDarwin; // FIXME: eliminate. // Necessary for Darwin to print out the apprioriate types of linker stubs std::set<std::string> FnStubs, GVStubs, LinkOnceStubs; |

