[llvm-commits] [llvm] r53360 - /llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp

Dale Johannesen dalej at apple.com
Wed Jul 9 14:20:56 PDT 2008


Author: johannes
Date: Wed Jul  9 16:20:54 2008
New Revision: 53360

URL: http://llvm.org/viewvc/llvm-project?rev=53360&view=rev
Log:
Emit debug info for data-only files.  ARM version.


Modified:
    llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp?rev=53360&r1=53359&r2=53360&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Wed Jul  9 16:20:54 2008
@@ -42,11 +42,13 @@
 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(NULL), 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 @@
 bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   AFI = MF.getInfo<ARMFunctionInfo>();
 
-  DW.SetModuleInfo(&getAnalysis<MachineModuleInfo>());
-
   SetupMachineFunction(MF);
   O << "\n";
 
@@ -800,6 +800,11 @@
   
   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);





More information about the llvm-commits mailing list