diff options
author | Dale Johannesen <dalej@apple.com> | 2008-07-08 21:56:22 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-07-08 21:56:22 +0000 |
commit | b9097a71d41d61331f545b7fec163ff0b8f8e45c (patch) | |
tree | c8b9e536f17108ff6a5ed6e8017bcd3c16c34348 /llvm/lib/Target/ARM/ARMAsmPrinter.cpp | |
parent | 45a4ec1a270c596268ad801b4d7e093425ae548a (diff) | |
download | bcm5719-llvm-b9097a71d41d61331f545b7fec163ff0b8f8e45c.tar.gz bcm5719-llvm-b9097a71d41d61331f545b7fec163ff0b8f8e45c.zip |
Make debug info come out in data-only files.
This is a question of the debugging setup code not
being called at the right time, and it's called from
target-dependent code for some reason. I have only
attempted to fix Darwin, but I'm pretty sure it's
broken elsewhere; I'll leave that to people who can
test it.
llvm-svn: 53254
Diffstat (limited to 'llvm/lib/Target/ARM/ARMAsmPrinter.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMAsmPrinter.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp index 23e5e37cf06..25b42c5db8f 100644 --- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp @@ -42,11 +42,13 @@ STATISTIC(EmittedInsts, "Number of machine instrs printed"); namespace { struct VISIBILITY_HIDDEN ARMAsmPrinter : public AsmPrinter { ARMAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T) - : AsmPrinter(O, TM, T), DW(O, this, T), AFI(NULL), InCPMode(false) { + : AsmPrinter(O, TM, T), DW(O, this, T), MMI(0), AFI(NULL), + InCPMode(false) { Subtarget = &TM.getSubtarget<ARMSubtarget>(); } DwarfWriter DW; + MachineModuleInfo *MMI; /// Subtarget - Keep a pointer to the ARMSubtarget around so that we can /// make the right decision when printing asm code for different targets. @@ -176,8 +178,6 @@ FunctionPass *llvm::createARMCodePrinterPass(std::ostream &o, bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) { AFI = MF.getInfo<ARMFunctionInfo>(); - DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>()); - SetupMachineFunction(MF); O << "\n"; @@ -800,6 +800,11 @@ bool ARMAsmPrinter::doInitialization(Module &M) { bool Result = AsmPrinter::doInitialization(M); + // AsmPrinter::doInitialization should have done this analysis. + MMI = getAnalysisToUpdate<MachineModuleInfo>(); + assert(MMI); + DW.SetModuleInfo(MMI); + // Darwin wants symbols to be quoted if they have complex names. if (Subtarget->isTargetDarwin()) Mang->setUseQuotes(true); |