Overhaul my earlier submission due to feedback. It's a large patch, but most of
authorBill Wendling <isanbard@gmail.com>
Tue, 24 Feb 2009 08:30:20 +0000 (08:30 +0000)
committerBill Wendling <isanbard@gmail.com>
Tue, 24 Feb 2009 08:30:20 +0000 (08:30 +0000)
them are generic changes.

- Use the "fast" flag that's already being passed into the asm printers instead
  of shoving it into the DwarfWriter.

- Instead of calling "MI->getParent()->getParent()" for every MI, set the
  machine function when calling "runOnMachineFunction" in the asm printers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65379 91177308-0d34-0410-b5e6-96231b3b80d8

43 files changed:
include/llvm/CodeGen/AsmPrinter.h
include/llvm/CodeGen/DwarfWriter.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/SelectionDAG/FastISel.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
lib/Target/ARM/ARM.h
lib/Target/ARM/ARMTargetMachine.cpp
lib/Target/ARM/ARMTargetMachine.h
lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
lib/Target/Alpha/Alpha.h
lib/Target/Alpha/AlphaTargetMachine.cpp
lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
lib/Target/CellSPU/SPU.h
lib/Target/CellSPU/SPUTargetMachine.cpp
lib/Target/IA64/IA64.h
lib/Target/IA64/IA64AsmPrinter.cpp
lib/Target/IA64/IA64TargetMachine.cpp
lib/Target/Mips/Mips.h
lib/Target/Mips/MipsAsmPrinter.cpp
lib/Target/Mips/MipsTargetMachine.cpp
lib/Target/PIC16/PIC16.h
lib/Target/PIC16/PIC16AsmPrinter.cpp
lib/Target/PIC16/PIC16AsmPrinter.h
lib/Target/PIC16/PIC16TargetMachine.cpp
lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
lib/Target/PowerPC/PPC.h
lib/Target/PowerPC/PPCTargetMachine.cpp
lib/Target/PowerPC/PPCTargetMachine.h
lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
lib/Target/Sparc/Sparc.h
lib/Target/Sparc/SparcTargetMachine.cpp
lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h
lib/Target/X86/AsmPrinter/X86AsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h
lib/Target/X86/X86.h
lib/Target/X86/X86TargetMachine.cpp
lib/Target/X86/X86TargetMachine.h
lib/Target/XCore/XCore.h
lib/Target/XCore/XCoreAsmPrinter.cpp
lib/Target/XCore/XCoreTargetMachine.cpp
utils/TableGen/AsmWriterEmitter.cpp

index 9c528f10fcaf36b592c4f5ea8b6b87d6a6968dd8..c619655e7a2946f4b45ef2e9281eca22bfb25f08 100644 (file)
@@ -65,6 +65,8 @@ namespace llvm {
     // Necessary for external weak linkage support
     std::set<const GlobalValue*> ExtWeakSymbols;
 
+    /// Fast - Generating code via fast instruction selection.
+    bool Fast;
   public:
     /// Output stream on which we're printing assembly code.
     ///
@@ -82,6 +84,9 @@ namespace llvm {
     ///
     const TargetRegisterInfo *TRI;
 
+    /// The current machine function.
+    const MachineFunction *MF;
+
     /// Name-mangler for global names.
     ///
     Mangler *Mang;
@@ -101,7 +106,8 @@ namespace llvm {
     bool IsInTextSection;
   
   protected:
-    AsmPrinter(raw_ostream &o, TargetMachine &TM, const TargetAsmInfo *T);
+    AsmPrinter(raw_ostream &o, TargetMachine &TM,
+               const TargetAsmInfo *T, bool F);
     
   public:
     virtual ~AsmPrinter();
index 14fc89bf18ca3bdc4dfb379a091c3be2bfc566a1..c7682c292186cb0629c03cfeabad0b52769887ec 100644 (file)
@@ -49,9 +49,6 @@ private:
   ///
   DwarfException *DE;
 
-  /// FastCodeGen - True if generating code via the "fast" isel.
-  /// 
-  bool FastCodeGen;
 public:
   static char ID; // Pass identification, replacement for typeid
 
@@ -107,9 +104,6 @@ public:
   /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should
   /// be emitted.
   bool ShouldEmitDwarfDebug() const;
-
-  bool getFastCodeGen() const { return FastCodeGen; }
-  void setFastCodeGen(bool Fast) { FastCodeGen = Fast; }
 };
 
 
index d4dd79572ed3b19dacd5e28932973338c9dce366..fd71ba971e716e26b98d5e7fa606366d5040eddf 100644 (file)
@@ -37,8 +37,8 @@ using namespace llvm;
 
 char AsmPrinter::ID = 0;
 AsmPrinter::AsmPrinter(raw_ostream &o, TargetMachine &tm,
-                       const TargetAsmInfo *T)
-  : MachineFunctionPass(&ID), FunctionNumber(0), O(o),
+                       const TargetAsmInfo *T, bool F)
+  : MachineFunctionPass(&ID), FunctionNumber(0), Fast(F), O(o),
     TM(tm), TAI(T), TRI(tm.getRegisterInfo()),
     IsInTextSection(false)
 {}
index c1b93bf422dfa586fd256caf92d12938c6c5afe8..fb3d101f1221baf6285f82d8cbb4c1ff2c58c336 100644 (file)
@@ -370,7 +370,6 @@ bool FastISel::SelectCall(User *I) {
       unsigned Line = Subprogram.getLineNumber();
       unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile);
       setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(SrcFile, Line, 0)));
-      DW->setFastCodeGen(true);
 
       if (DW->getRecordSourceLineCount() != 1) {
         const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
index bc417138bfd928ef533718d45ac7751c8caac83f..4791465b096c5e2b566d567f0c1093aaddc0d562 100644 (file)
@@ -3915,7 +3915,6 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
       if (Fast)
         DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
                                  getRoot(), LabelID));
-      DW->setFastCodeGen(Fast);
     }
 
     return 0;
index 0358230c66a85d1442d274297f774a08888aebe6..87d2cffe2aa5f635b7f08eb0e6b7a04a2ba46736 100644 (file)
@@ -89,7 +89,9 @@ inline static const char *ARMCondCodeToString(ARMCC::CondCodes CC) {
 }
 
 FunctionPass *createARMISelDag(ARMTargetMachine &TM);
-FunctionPass *createARMCodePrinterPass(raw_ostream &O, ARMTargetMachine &TM);
+FunctionPass *createARMCodePrinterPass(raw_ostream &O,
+                                       ARMTargetMachine &TM,
+                                       bool Fast);
 FunctionPass *createARMCodeEmitterPass(ARMTargetMachine &TM,
                                        MachineCodeEmitter &MCE);
 FunctionPass *createARMLoadStoreOptimizationPass();
index a5d3659d3c74f4ca666ec7eb7530ecbe6484a1bb..919c2ffaf8fd43de45fed34fd204a0268da728bf 100644 (file)
@@ -157,7 +157,7 @@ bool ARMTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
   // Output assembly language.
   assert(AsmPrinterCtor && "AsmPrinter was not linked in");
   if (AsmPrinterCtor)
-    PM.add(AsmPrinterCtor(Out, *this));
+    PM.add(AsmPrinterCtor(Out, *this, Fast));
 
   return false;
 }
@@ -174,7 +174,7 @@ bool ARMTargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast,
   if (DumpAsm) {
     assert(AsmPrinterCtor && "AsmPrinter was not linked in");
     if (AsmPrinterCtor)
-      PM.add(AsmPrinterCtor(errs(), *this));
+      PM.add(AsmPrinterCtor(errs(), *this, Fast));
   }
 
   return false;
@@ -187,7 +187,7 @@ bool ARMTargetMachine::addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
   if (DumpAsm) {
     assert(AsmPrinterCtor && "AsmPrinter was not linked in");
     if (AsmPrinterCtor)
-      PM.add(AsmPrinterCtor(errs(), *this));
+      PM.add(AsmPrinterCtor(errs(), *this, Fast));
   }
 
   return false;
index 6fe9a222b4df9d93a1f48ad1bb0940f916308cd8..5403740742750d3d2d563080b0fd1dd43a83ef90 100644 (file)
@@ -40,7 +40,8 @@ protected:
   // To avoid having target depend on the asmprinter stuff libraries, asmprinter
   // set this functions to ctor pointer at startup time if they are linked in.
   typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
-                                            ARMTargetMachine &tm);
+                                            ARMTargetMachine &tm,
+                                            bool fast);
   static AsmPrinterCtorFn AsmPrinterCtor;
 
 public:
index 822cc2eb75b3c6a5590d62b4e041afdcad0e2d68..2f1da52f2d2792e92dc54793f75b9e730233fedf 100644 (file)
@@ -42,13 +42,7 @@ using namespace llvm;
 STATISTIC(EmittedInsts, "Number of machine instrs printed");
 
 namespace {
-  struct VISIBILITY_HIDDEN ARMAsmPrinter : public AsmPrinter {
-    ARMAsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
-      : AsmPrinter(O, TM, T), DW(0), MMI(NULL), AFI(NULL), MCP(NULL),
-        InCPMode(false) {
-      Subtarget = &TM.getSubtarget<ARMSubtarget>();
-    }
-
+  class VISIBILITY_HIDDEN ARMAsmPrinter : public AsmPrinter {
     DwarfWriter *DW;
     MachineModuleInfo *MMI;
 
@@ -85,7 +79,14 @@ namespace {
 
     /// True if asm printer is printing a series of CONSTPOOL_ENTRY.
     bool InCPMode;
-    
+  public:
+    ARMAsmPrinter(raw_ostream &O, TargetMachine &TM,
+                  const TargetAsmInfo *T, bool F)
+      : AsmPrinter(O, TM, T, F), DW(0), MMI(NULL), AFI(NULL), MCP(NULL),
+        InCPMode(false) {
+      Subtarget = &TM.getSubtarget<ARMSubtarget>();
+    }
+
     virtual const char *getPassName() const {
       return "ARM Assembly Printer";
     }
@@ -183,6 +184,8 @@ namespace {
 /// method to print assembly for each instruction.
 ///
 bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+  this->MF = &MF;
+
   AFI = MF.getInfo<ARMFunctionInfo>();
   MCP = MF.getConstantPool();
 
@@ -1039,8 +1042,9 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
 /// regardless of whether the function is in SSA form.
 ///
 FunctionPass *llvm::createARMCodePrinterPass(raw_ostream &o,
-                                             ARMTargetMachine &tm) {
-  return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo());
+                                             ARMTargetMachine &tm,
+                                             bool fast) {
+  return new ARMAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
 }
 
 namespace {
index 9af46d0c70f0a273c6ef1f8c446f8973b41e275b..e885c80b27aa0bd30ebf3eee81c238a7f58ef5ad 100644 (file)
@@ -25,7 +25,8 @@ namespace llvm {
 
   FunctionPass *createAlphaISelDag(AlphaTargetMachine &TM);
   FunctionPass *createAlphaCodePrinterPass(raw_ostream &OS,
-                                             TargetMachine &TM);
+                                           TargetMachine &TM,
+                                           bool Fast);
   FunctionPass *createAlphaPatternInstructionSelector(TargetMachine &TM);
   FunctionPass *createAlphaCodeEmitterPass(AlphaTargetMachine &TM,
                                            MachineCodeEmitter &MCE);
index c65485b061ca8bdd384a714f53cfd07806e3c8ac..db3567fa61add8115540cdd4a3ac914eafdbc4c1 100644 (file)
@@ -88,14 +88,14 @@ bool AlphaTargetMachine::addPreEmitPass(PassManagerBase &PM, bool Fast) {
 bool AlphaTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, 
                                             raw_ostream &Out) {
   PM.add(createAlphaLLRPPass(*this));
-  PM.add(createAlphaCodePrinterPass(Out, *this));
+  PM.add(createAlphaCodePrinterPass(Out, *this, Fast));
   return false;
 }
 bool AlphaTargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast,
                                         bool DumpAsm, MachineCodeEmitter &MCE) {
   PM.add(createAlphaCodeEmitterPass(*this, MCE));
   if (DumpAsm)
-    PM.add(createAlphaCodePrinterPass(errs(), *this));
+    PM.add(createAlphaCodePrinterPass(errs(), *this, Fast));
   return false;
 }
 bool AlphaTargetMachine::addSimpleCodeEmitter(PassManagerBase &PM,
index fdfee1bc1508e8b4cd16891b12c8db0334c3fe50..536e5920f383eb672855d2c05575e25a1203c7ea 100644 (file)
@@ -33,13 +33,12 @@ STATISTIC(EmittedInsts, "Number of machine instrs printed");
 
 namespace {
   struct VISIBILITY_HIDDEN AlphaAsmPrinter : public AsmPrinter {
-
     /// Unique incrementer for label values for referencing Global values.
     ///
 
-    AlphaAsmPrinter(raw_ostream &o, TargetMachine &tm, const TargetAsmInfo *T)
-      : AsmPrinter(o, tm, T) {
-    }
+    AlphaAsmPrinter(raw_ostream &o, TargetMachine &tm,
+                    const TargetAsmInfo *T, bool F)
+      : AsmPrinter(o, tm, T, F) {}
 
     virtual const char *getPassName() const {
       return "Alpha Assembly Printer";
@@ -68,8 +67,9 @@ namespace {
 /// regardless of whether the function is in SSA form.
 ///
 FunctionPass *llvm::createAlphaCodePrinterPass(raw_ostream &o,
-                                               TargetMachine &tm) {
-  return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo());
+                                               TargetMachine &tm,
+                                               bool fast) {
+  return new AlphaAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
 }
 
 #include "AlphaGenAsmWriter.inc"
@@ -139,6 +139,8 @@ void AlphaAsmPrinter::printOp(const MachineOperand &MO, bool IsCallOp) {
 /// method to print assembly for each instruction.
 ///
 bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+  this->MF = &MF;
+
   SetupMachineFunction(MF);
   O << "\n\n";
 
index e9b3fc2d26b27e1ca2b457b671788c5505e54dd0..474a8ad3a4c7f590b3b48166e0bcc10602a1d78c 100644 (file)
@@ -45,13 +45,12 @@ namespace {
 
   const std::string bss_section(".bss");
 
-  struct VISIBILITY_HIDDEN SPUAsmPrinter : public AsmPrinter {
+  class VISIBILITY_HIDDEN SPUAsmPrinter : public AsmPrinter {
     std::set<std::string> FnStubs, GVStubs;
-
-    SPUAsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T) :
-      AsmPrinter(O, TM, T)
-    {
-    }
+  public:
+    SPUAsmPrinter(raw_ostream &O, TargetMachine &TM,
+                  const TargetAsmInfo *T, bool F) :
+      AsmPrinter(O, TM, T, F) {}
 
     virtual const char *getPassName() const {
       return "STI CBEA SPU Assembly Printer";
@@ -285,17 +284,13 @@ namespace {
   };
 
   /// LinuxAsmPrinter - SPU assembly printer, customized for Linux
-  struct VISIBILITY_HIDDEN LinuxAsmPrinter : public SPUAsmPrinter {
-
+  class VISIBILITY_HIDDEN LinuxAsmPrinter : public SPUAsmPrinter {
     DwarfWriter *DW;
     MachineModuleInfo *MMI;
-
+  public:
     LinuxAsmPrinter(raw_ostream &O, SPUTargetMachine &TM,
-                    const TargetAsmInfo *T) :
-      SPUAsmPrinter(O, TM, T),
-      DW(0),
-      MMI(0)
-    { }
+                    const TargetAsmInfo *T, bool F)
+      : SPUAsmPrinter(O, TM, T, F), DW(0), MMI(0) {}
 
     virtual const char *getPassName() const {
       return "STI CBEA SPU Assembly Printer";
@@ -427,6 +422,8 @@ void SPUAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
 bool
 LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF)
 {
+  this->MF = &MF;
+
   SetupMachineFunction(MF);
   O << "\n\n";
 
@@ -613,6 +610,7 @@ bool LinuxAsmPrinter::doFinalization(Module &M) {
 /// that the Linux SPU assembler can deal with.
 ///
 FunctionPass *llvm::createSPUAsmPrinterPass(raw_ostream &o,
-                                            SPUTargetMachine &tm) {
-  return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo());
+                                            SPUTargetMachine &tm,
+                                            bool fast) {
+  return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
 }
index a6a911067fd836946b91f580a0463cbaea9d00b3..a7a9a7718200c3337caad5260581700cf55fea1a 100644 (file)
@@ -23,7 +23,9 @@ namespace llvm {
   class raw_ostream;
 
   FunctionPass *createSPUISelDag(SPUTargetMachine &TM);
-  FunctionPass *createSPUAsmPrinterPass(raw_ostream &o, SPUTargetMachine &tm);
+  FunctionPass *createSPUAsmPrinterPass(raw_ostream &o,
+                                        SPUTargetMachine &tm,
+                                        bool fast);
 
   /*--== Utility functions/predicates/etc used all over the place: --==*/
   //! Predicate test for a signed 10-bit value
index 217da2c9ff45d884b818a8e838919382fe3cb9c2..ba5d2f2507c50dfedf40d95f7170001fe7a241c7 100644 (file)
@@ -90,6 +90,6 @@ SPUTargetMachine::addInstSelector(PassManagerBase &PM, bool Fast)
 
 bool SPUTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, 
                                           raw_ostream &Out) {
-  PM.add(createSPUAsmPrinterPass(Out, *this));
+  PM.add(createSPUAsmPrinterPass(Out, *this, Fast));
   return false;
 }
index 030a23382f7fa0e95f4685575d1448e68e738b76..ab9e67764e122bacd786774a182893235110402d 100644 (file)
@@ -35,7 +35,9 @@ FunctionPass *createIA64BundlingPass(IA64TargetMachine &TM);
 /// using the given target machine description.  This should work
 /// regardless of whether the function is in SSA form.
 ///
-FunctionPass *createIA64CodePrinterPass(raw_ostream &o, IA64TargetMachine &tm);
+FunctionPass *createIA64CodePrinterPass(raw_ostream &o,
+                                        IA64TargetMachine &tm,
+                                        bool fast);
 
 } // End llvm namespace
 
index 567e04c4b150a6bc9a3aebb6aa08d46905d6b04f..00474309d560d1afa8e17f22f3b327286621670f 100644 (file)
@@ -34,12 +34,12 @@ using namespace llvm;
 STATISTIC(EmittedInsts, "Number of machine instrs printed");
 
 namespace {
-  struct IA64AsmPrinter : public AsmPrinter {
+  class IA64AsmPrinter : public AsmPrinter {
     std::set<std::string> ExternalFunctionNames, ExternalObjectNames;
-
-    IA64AsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
-      : AsmPrinter(O, TM, T) {
-    }
+  public:
+    IA64AsmPrinter(raw_ostream &O, TargetMachine &TM,
+                   const TargetAsmInfo *T, bool F)
+      : AsmPrinter(O, TM, T, F) {}
 
     virtual const char *getPassName() const {
       return "IA64 Assembly Printer";
@@ -124,6 +124,8 @@ namespace {
 /// method to print assembly for each instruction.
 ///
 bool IA64AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+  this->MF = &MF;
+
   SetupMachineFunction(MF);
   O << "\n\n";
 
@@ -365,6 +367,7 @@ bool IA64AsmPrinter::doFinalization(Module &M) {
 /// the given target machine description.
 ///
 FunctionPass *llvm::createIA64CodePrinterPass(raw_ostream &o,
-                                              IA64TargetMachine &tm) {
-  return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo());
+                                              IA64TargetMachine &tm,
+                                              bool fast) {
+  return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
 }
index 459e8ed7a2303594fa5a86c16105a51b94375e03..1cac9e4ea69cdbcb6c696b9ffc0312a037f6a59d 100644 (file)
@@ -84,7 +84,7 @@ bool IA64TargetMachine::addPreEmitPass(PassManagerBase &PM, bool Fast) {
 }
 bool IA64TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, 
                                            raw_ostream &Out) {
-  PM.add(createIA64CodePrinterPass(Out, *this));
+  PM.add(createIA64CodePrinterPass(Out, *this, Fast));
   return false;
 }
 
index 03f5a525ba61ee796341e5a287d7b1f1624dcebc..28c11b0eb911115c9b11e7b02f2bc7471247d4eb 100644 (file)
@@ -24,7 +24,8 @@ namespace llvm {
   FunctionPass *createMipsISelDag(MipsTargetMachine &TM);
   FunctionPass *createMipsDelaySlotFillerPass(MipsTargetMachine &TM);
   FunctionPass *createMipsCodePrinterPass(raw_ostream &OS, 
-                                          MipsTargetMachine &TM);
+                                          MipsTargetMachine &TM,
+                                          bool Fast);
 } // end namespace llvm;
 
 // Defines symbolic names for Mips registers.  This defines a mapping from
index 94cd71a760919e96ed29d03dc8262d81b3404a1b..732c5d796ca296ab191538790794e1dae0b3509a 100644 (file)
@@ -46,13 +46,12 @@ using namespace llvm;
 STATISTIC(EmittedInsts, "Number of machine instrs printed");
 
 namespace {
-  struct VISIBILITY_HIDDEN MipsAsmPrinter : public AsmPrinter {
-
+  class VISIBILITY_HIDDEN MipsAsmPrinter : public AsmPrinter {
     const MipsSubtarget *Subtarget;
-
+  public:
     MipsAsmPrinter(raw_ostream &O, MipsTargetMachine &TM, 
-                   const TargetAsmInfo *T): 
-                   AsmPrinter(O, TM, T) {
+                   const TargetAsmInfo *T, bool F)
+      : AsmPrinter(O, TM, T, F) {
       Subtarget = &TM.getSubtarget<MipsSubtarget>();
     }
 
@@ -91,9 +90,9 @@ namespace {
 /// using the given target machine description.  This should work
 /// regardless of whether the function is in SSA form.
 FunctionPass *llvm::createMipsCodePrinterPass(raw_ostream &o,
-                                              MipsTargetMachine &tm
-{
-  return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo());
+                                              MipsTargetMachine &tm,
+                                              bool fast) {
+  return new MipsAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
 }
 
 //===----------------------------------------------------------------------===//
@@ -266,6 +265,8 @@ emitFunctionEnd(MachineFunction &MF)
 bool MipsAsmPrinter::
 runOnMachineFunction(MachineFunction &MF) 
 {
+  this->MF = &MF;
+
   SetupMachineFunction(MF);
 
   // Print out constants referenced by the function
index ff2e5b81589c9950090723f25fcdb24956418764..4b13b78d020b5cf82f31b03b169334c972ae7b2e 100644 (file)
@@ -128,6 +128,6 @@ addAssemblyEmitter(PassManagerBase &PM, bool Fast,
                    raw_ostream &Out) 
 {
   // Output assembly language.
-  PM.add(createMipsCodePrinterPass(Out, *this));
+  PM.add(createMipsCodePrinterPass(Out, *this, Fast));
   return false;
 }
index e37ef4f209096995c57d486ad228f187479801ce..eb7fdf914ac49c5e0e22d2222f9482a7a9b63b2c 100644 (file)
@@ -74,7 +74,8 @@ namespace PIC16CC {
 
   FunctionPass *createPIC16ISelDag(PIC16TargetMachine &TM);
   FunctionPass *createPIC16CodePrinterPass(raw_ostream &OS, 
-                                           PIC16TargetMachine &TM);
+                                           PIC16TargetMachine &TM,
+                                           bool Fast);
 } // end namespace llvm;
 
 // Defines symbolic names for PIC16 registers.  This defines a mapping from
index 8e80eeabe2d706a043387bd70b5dc0cc9470050c..a073be248e4a06bf0e2d9f57e3c80465b6dabe2f 100644 (file)
@@ -90,6 +90,8 @@ bool PIC16AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
 /// method to print assembly for each instruction.
 ///
 bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+  this->MF = &MF;
+
   // This calls the base class function required to be called at beginning
   // of runOnMachineFunction.
   SetupMachineFunction(MF);
@@ -133,8 +135,9 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
 /// regardless of whether the function is in SSA form.
 ///
 FunctionPass *llvm::createPIC16CodePrinterPass(raw_ostream &o,
-                                               PIC16TargetMachine &tm) {
-  return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo());
+                                               PIC16TargetMachine &tm,
+                                               bool fast) {
+  return new PIC16AsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
 }
 
 void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
index ce79afd6079ea22c6809f2cdba396665a76a24b1..390368633093f7893c1dbd765e594e2191bca9dd 100644 (file)
@@ -24,8 +24,9 @@
 
 namespace llvm {
   struct VISIBILITY_HIDDEN PIC16AsmPrinter : public AsmPrinter {
-    PIC16AsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
-      : AsmPrinter(O, TM, T) {
+    PIC16AsmPrinter(raw_ostream &O, TargetMachine &TM,
+                    const TargetAsmInfo *T, bool F)
+      : AsmPrinter(O, TM, T, F) {
       CurrentBankselLabelInBasicBlock = "";
       IsRomData = false;
     }
index 06f11174e1b40e6c4afbec8266463d5c4baa4b90..8ca0727ffacf9f95f1c344c99d7fa1039b8796dc 100644 (file)
@@ -64,7 +64,7 @@ bool PIC16TargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) {
 bool PIC16TargetMachine::
 addAssemblyEmitter(PassManagerBase &PM, bool Fast, raw_ostream &Out) {
   // Output assembly language.
-  PM.add(createPIC16CodePrinterPass(Out, *this));
+  PM.add(createPIC16CodePrinterPass(Out, *this, Fast));
   return false;
 }
 
index 6c5d8b9d476756f94709c488fdf348d5baef839a..cc0efa8fd310f367f9037ad64f3b4a79528e1a1c 100644 (file)
@@ -49,13 +49,15 @@ using namespace llvm;
 STATISTIC(EmittedInsts, "Number of machine instrs printed");
 
 namespace {
-  struct VISIBILITY_HIDDEN PPCAsmPrinter : public AsmPrinter {
+  class VISIBILITY_HIDDEN PPCAsmPrinter : public AsmPrinter {
+  protected:
     StringSet<> FnStubs, GVStubs, HiddenGVStubs;
     const PPCSubtarget &Subtarget;
-
-    PPCAsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
-      : AsmPrinter(O, TM, T), Subtarget(TM.getSubtarget<PPCSubtarget>()) {
-    }
+  public:
+    PPCAsmPrinter(raw_ostream &O, TargetMachine &TM,
+                  const TargetAsmInfo *T, bool F)
+      : AsmPrinter(O, TM, T, F),
+        Subtarget(TM.getSubtarget<PPCSubtarget>()) {}
 
     virtual const char *getPassName() const {
       return "PowerPC Assembly Printer";
@@ -291,14 +293,13 @@ namespace {
   };
 
   /// PPCLinuxAsmPrinter - PowerPC assembly printer, customized for Linux
-  struct VISIBILITY_HIDDEN PPCLinuxAsmPrinter : public PPCAsmPrinter {
+  class VISIBILITY_HIDDEN PPCLinuxAsmPrinter : public PPCAsmPrinter {
     DwarfWriter *DW;
     MachineModuleInfo *MMI;
-
+  public:
     PPCLinuxAsmPrinter(raw_ostream &O, PPCTargetMachine &TM,
-                    const TargetAsmInfo *T)
-      : PPCAsmPrinter(O, TM, T), DW(0), MMI(0) {
-    }
+                       const TargetAsmInfo *T, bool F)
+      : PPCAsmPrinter(O, TM, T, F), DW(0), MMI(0) {}
 
     virtual const char *getPassName() const {
       return "Linux PPC Assembly Printer";
@@ -320,15 +321,14 @@ namespace {
 
   /// PPCDarwinAsmPrinter - PowerPC assembly printer, customized for Darwin/Mac
   /// OS X
-  struct VISIBILITY_HIDDEN PPCDarwinAsmPrinter : public PPCAsmPrinter {
-
+  class VISIBILITY_HIDDEN PPCDarwinAsmPrinter : public PPCAsmPrinter {
     DwarfWriter *DW;
     MachineModuleInfo *MMI;
     raw_ostream &OS;
+  public:
     PPCDarwinAsmPrinter(raw_ostream &O, PPCTargetMachine &TM,
-                        const TargetAsmInfo *T)
-      : PPCAsmPrinter(O, TM, T), DW(0), MMI(0), OS(O) {
-    }
+                        const TargetAsmInfo *T, bool F)
+      : PPCAsmPrinter(O, TM, T, F), DW(0), MMI(0), OS(O) {}
 
     virtual const char *getPassName() const {
       return "Darwin PPC Assembly Printer";
@@ -571,6 +571,7 @@ void PPCAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
 /// method to print assembly for each instruction.
 ///
 bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+  this->MF = &MF;
 
   SetupMachineFunction(MF);
   O << "\n\n";
@@ -764,6 +765,8 @@ bool PPCLinuxAsmPrinter::doFinalization(Module &M) {
 /// method to print assembly for each instruction.
 ///
 bool PPCDarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+  this->MF = &MF;
+
   SetupMachineFunction(MF);
   O << "\n\n";
 
@@ -1146,13 +1149,14 @@ bool PPCDarwinAsmPrinter::doFinalization(Module &M) {
 /// Darwin assembler can deal with.
 ///
 FunctionPass *llvm::createPPCAsmPrinterPass(raw_ostream &o,
-                                            PPCTargetMachine &tm) {
+                                            PPCTargetMachine &tm,
+                                            bool fast) {
   const PPCSubtarget *Subtarget = &tm.getSubtarget<PPCSubtarget>();
 
   if (Subtarget->isDarwin()) {
-    return new PPCDarwinAsmPrinter(o, tm, tm.getTargetAsmInfo());
+    return new PPCDarwinAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
   } else {
-    return new PPCLinuxAsmPrinter(o, tm, tm.getTargetAsmInfo());
+    return new PPCLinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
   }
 }
 
index 773b9c169b46b041a2586e1ab63c3872e21f6559..09809285f710b8869b843154c099a3541cce5f26 100644 (file)
@@ -27,7 +27,8 @@ namespace llvm {
 FunctionPass *createPPCBranchSelectionPass();
 FunctionPass *createPPCISelDag(PPCTargetMachine &TM);
 FunctionPass *createPPCAsmPrinterPass(raw_ostream &OS,
-                                      PPCTargetMachine &TM);
+                                      PPCTargetMachine &TM,
+                                      bool Fast);
 FunctionPass *createPPCCodeEmitterPass(PPCTargetMachine &TM,
                                        MachineCodeEmitter &MCE);
 } // end namespace llvm;
index 0ff65d2a0d325892efabd065a2a4707a0b5c5382..d142fd161d6954c17576d833c1a0ab6e7ff34ac3 100644 (file)
@@ -146,7 +146,7 @@ bool PPCTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
                                           raw_ostream &Out) {
   assert(AsmPrinterCtor && "AsmPrinter was not linked in");
   if (AsmPrinterCtor)
-    PM.add(AsmPrinterCtor(Out, *this));
+    PM.add(AsmPrinterCtor(Out, *this, Fast));
 
   return false;
 }
@@ -176,7 +176,7 @@ bool PPCTargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast,
   if (DumpAsm) {
     assert(AsmPrinterCtor && "AsmPrinter was not linked in");
     if (AsmPrinterCtor)
-      PM.add(AsmPrinterCtor(errs(), *this));
+      PM.add(AsmPrinterCtor(errs(), *this, Fast));
   }
 
   return false;
@@ -189,7 +189,7 @@ bool PPCTargetMachine::addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
   if (DumpAsm) {
     assert(AsmPrinterCtor && "AsmPrinter was not linked in");
     if (AsmPrinterCtor)
-      PM.add(AsmPrinterCtor(errs(), *this));
+      PM.add(AsmPrinterCtor(errs(), *this, Fast));
   }
 
   return false;
index 8d65fd2479f658fd89603ac763c2cc33e85a43a4..7cee59373170156b14fa26bdac12b616c4191cf0 100644 (file)
@@ -45,7 +45,8 @@ protected:
   // To avoid having target depend on the asmprinter stuff libraries, asmprinter
   // set this functions to ctor pointer at startup time if they are linked in.
   typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
-                                            PPCTargetMachine &tm);
+                                            PPCTargetMachine &tm, 
+                                            bool fast);
   static AsmPrinterCtorFn AsmPrinterCtor;
 
 public:
index f720d47570eda8f46ba407496bc648e4c839ffac..80976bb25917dde83c65dcf1de92d440a69743de 100644 (file)
@@ -40,17 +40,17 @@ using namespace llvm;
 STATISTIC(EmittedInsts, "Number of machine instrs printed");
 
 namespace {
-  struct VISIBILITY_HIDDEN SparcAsmPrinter : public AsmPrinter {
-    SparcAsmPrinter(raw_ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
-      : AsmPrinter(O, TM, T) {
-    }
-
+  class VISIBILITY_HIDDEN SparcAsmPrinter : public AsmPrinter {
     /// We name each basic block in a Function with a unique number, so
     /// that we can consistently refer to them later. This is cleared
     /// at the beginning of each call to runOnMachineFunction().
     ///
     typedef std::map<const Value *, unsigned> ValueMapTy;
     ValueMapTy NumberForBB;
+  public:
+    SparcAsmPrinter(raw_ostream &O, TargetMachine &TM,
+                    const TargetAsmInfo *T, bool F)
+      : AsmPrinter(O, TM, T, F) {}
 
     virtual const char *getPassName() const {
       return "Sparc Assembly Printer";
@@ -81,14 +81,17 @@ namespace {
 /// regardless of whether the function is in SSA form.
 ///
 FunctionPass *llvm::createSparcCodePrinterPass(raw_ostream &o,
-                                               TargetMachine &tm) {
-  return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo());
+                                               TargetMachine &tm,
+                                               bool fast) {
+  return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
 }
 
 /// runOnMachineFunction - This uses the printInstruction()
 /// method to print assembly for each instruction.
 ///
 bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+  this->MF = &MF;
+
   SetupMachineFunction(MF);
 
   // Print out constants referenced by the function
index baac8f0159afc8c0b92546ad2c24b2ebf77f185a..c48118a0f11d0eab0c5c92e7ad80db22162c026c 100644 (file)
@@ -24,7 +24,8 @@ namespace llvm {
   class raw_ostream;
 
   FunctionPass *createSparcISelDag(SparcTargetMachine &TM);
-  FunctionPass *createSparcCodePrinterPass(raw_ostream &OS, TargetMachine &TM);
+  FunctionPass *createSparcCodePrinterPass(raw_ostream &OS,
+                                           TargetMachine &TM, bool Fast);
   FunctionPass *createSparcDelaySlotFillerPass(TargetMachine &TM);
   FunctionPass *createSparcFPMoverPass(TargetMachine &TM);
 } // end namespace llvm;
index 21c4205b37d96a054f7511e2a362a5999959c1b5..784800fd9229910755045fd0d59b80444ffeaab8 100644 (file)
@@ -85,6 +85,6 @@ bool SparcTargetMachine::addPreEmitPass(PassManagerBase &PM, bool Fast) {
 bool SparcTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, 
                                             raw_ostream &Out) {
   // Output assembly language.
-  PM.add(createSparcCodePrinterPass(Out, *this));
+  PM.add(createSparcCodePrinterPass(Out, *this, Fast));
   return false;
 }
index 6be9958dcf19365b08c341db1b731c8e5d9371ea..35407343dc0e13bbcb7ee283e9f78c773751b636 100644 (file)
@@ -28,15 +28,14 @@ namespace llvm {
 
 struct MachineJumpTableInfo;
 
-struct VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
-  MachineFunction *MF;
+class VISIBILITY_HIDDEN X86ATTAsmPrinter : public AsmPrinter {
   DwarfWriter *DW;
   MachineModuleInfo *MMI;
   const X86Subtarget *Subtarget;
-
+ public:
   X86ATTAsmPrinter(raw_ostream &O, X86TargetMachine &TM,
-                   const TargetAsmInfo *T)
-    : AsmPrinter(O, TM, T), DW(0), MMI(0) {
+                   const TargetAsmInfo *T, bool F)
+    : AsmPrinter(O, TM, T, F), DW(0), MMI(0) {
     Subtarget = &TM.getSubtarget<X86Subtarget>();
   }
 
index 48ee11f5a9d4afba60695cfa832d8a02a74c9099..9282f5f33d70de1f480aa0b7391a89acae9be18d 100644 (file)
@@ -24,13 +24,14 @@ using namespace llvm;
 /// machine description.
 ///
 FunctionPass *llvm::createX86CodePrinterPass(raw_ostream &o,
-                                             X86TargetMachine &tm) {
+                                             X86TargetMachine &tm,
+                                             bool fast) {
   const X86Subtarget *Subtarget = &tm.getSubtarget<X86Subtarget>();
 
   if (Subtarget->isFlavorIntel()) {
-    return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo());
+    return new X86IntelAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
   } else {
-    return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo());
+    return new X86ATTAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
   }
 }
 
index 4dedd026aa13fbc331cfbf6449eb18f5c3a23e9a..c4389aa4062027647688c6ffb8dbf782b5d7e925 100644 (file)
@@ -122,6 +122,7 @@ void X86IntelAsmPrinter::decorateName(std::string &Name,
 /// method to print assembly for each instruction.
 ///
 bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
+  this->MF = &MF;
   SetupMachineFunction(MF);
   O << "\n\n";
 
index 9762e938964ea4dfa063b7b442a11ef20cca4b38..5a399b3a4a43be648b4e638f77ede6b75fdbe816 100644 (file)
@@ -26,9 +26,8 @@ namespace llvm {
 
 struct VISIBILITY_HIDDEN X86IntelAsmPrinter : public AsmPrinter {
   X86IntelAsmPrinter(raw_ostream &O, X86TargetMachine &TM,
-                     const TargetAsmInfo *T)
-      : AsmPrinter(O, TM, T) {
-  }
+                     const TargetAsmInfo *T, bool F)
+    : AsmPrinter(O, TM, T, F) {}
 
   virtual const char *getPassName() const {
     return "X86 Intel-Style Assembly Printer";
index 135787b98a958a39fe2238d1ef4be4984b76d2a0..76fc4ffc83fa7e2158ee97dcc05b48d3b3d58173 100644 (file)
@@ -42,7 +42,9 @@ FunctionPass *createX87FPRegKillInserterPass();
 /// assembly code for a MachineFunction to the given output stream,
 /// using the given target machine description.
 ///
-FunctionPass *createX86CodePrinterPass(raw_ostream &o, X86TargetMachine &tm);
+FunctionPass *createX86CodePrinterPass(raw_ostream &o,
+                                       X86TargetMachine &tm,
+                                       bool fast);
 
 /// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
 /// to the specified MCE object.
index 10638df2e44a85053328582adcf9d5a937903f47..5fbe71e0b332c43fe2782c839a494325d921c80e 100644 (file)
@@ -210,7 +210,7 @@ bool X86TargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast,
                                           raw_ostream &Out) {
   assert(AsmPrinterCtor && "AsmPrinter was not linked in");
   if (AsmPrinterCtor)
-    PM.add(AsmPrinterCtor(Out, *this));
+    PM.add(AsmPrinterCtor(Out, *this, Fast));
   return false;
 }
 
@@ -236,7 +236,7 @@ bool X86TargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast,
   if (DumpAsm) {
     assert(AsmPrinterCtor && "AsmPrinter was not linked in");
     if (AsmPrinterCtor)
-      PM.add(AsmPrinterCtor(errs(), *this));
+      PM.add(AsmPrinterCtor(errs(), *this, Fast));
   }
 
   return false;
@@ -248,7 +248,7 @@ bool X86TargetMachine::addSimpleCodeEmitter(PassManagerBase &PM, bool Fast,
   if (DumpAsm) {
     assert(AsmPrinterCtor && "AsmPrinter was not linked in");
     if (AsmPrinterCtor)
-      PM.add(AsmPrinterCtor(errs(), *this));
+      PM.add(AsmPrinterCtor(errs(), *this, Fast));
   }
 
   return false;
index bb56d96533ab94e316e90401608602d693730987..49cf163e6ffe675adbba3db5d1cdbb55c0f33257 100644 (file)
@@ -44,7 +44,8 @@ protected:
   // To avoid having target depend on the asmprinter stuff libraries, asmprinter
   // set this functions to ctor pointer at startup time if they are linked in.
   typedef FunctionPass *(*AsmPrinterCtorFn)(raw_ostream &o,
-                                            X86TargetMachine &tm);
+                                            X86TargetMachine &tm,
+                                            bool fast);
   static AsmPrinterCtorFn AsmPrinterCtor;
 
 public:
index 347ac47ac3e7a94587fcae760116b9a736150a72..361a2ee2bb81302a572f4f98514135e60da361ce 100644 (file)
@@ -23,7 +23,8 @@ namespace llvm {
 
   FunctionPass *createXCoreISelDag(XCoreTargetMachine &TM);
   FunctionPass *createXCoreCodePrinterPass(raw_ostream &OS,
-                                           XCoreTargetMachine &TM);
+                                           XCoreTargetMachine &TM,
+                                           bool Fast);
 } // end namespace llvm;
 
 // Defines symbolic names for XCore registers.  This defines a mapping from
index 9e6e19fe44fd78382588c852314486e29c51e395..3a30f107d855ebc22704d7c324cb6a2747206fdc 100644 (file)
@@ -53,14 +53,14 @@ static cl::opt<unsigned> MaxThreads("xcore-max-threads", cl::Optional,
   cl::init(8));
 
 namespace {
-  struct VISIBILITY_HIDDEN XCoreAsmPrinter : public AsmPrinter {
-    XCoreAsmPrinter(raw_ostream &O, XCoreTargetMachine &TM,
-                    const TargetAsmInfo *T)
-      : AsmPrinter(O, TM, T), DW(0),
-        Subtarget(*TM.getSubtargetImpl()) { }
-
+  class VISIBILITY_HIDDEN XCoreAsmPrinter : public AsmPrinter {
     DwarfWriter *DW;
     const XCoreSubtarget &Subtarget;
+  public:
+    XCoreAsmPrinter(raw_ostream &O, XCoreTargetMachine &TM,
+                    const TargetAsmInfo *T, bool F)
+      : AsmPrinter(O, TM, T, F), DW(0),
+        Subtarget(*TM.getSubtargetImpl()) {}
 
     virtual const char *getPassName() const {
       return "XCore Assembly Printer";
@@ -104,8 +104,9 @@ namespace {
 /// regardless of whether the function is in SSA form.
 ///
 FunctionPass *llvm::createXCoreCodePrinterPass(raw_ostream &o,
-                                               XCoreTargetMachine &tm) {
-  return new XCoreAsmPrinter(o, tm, tm.getTargetAsmInfo());
+                                               XCoreTargetMachine &tm,
+                                               bool fast) {
+  return new XCoreAsmPrinter(o, tm, tm.getTargetAsmInfo(), fast);
 }
 
 // PrintEscapedString - Print each character of the specified string, escaping
@@ -293,6 +294,8 @@ emitFunctionEnd(MachineFunction &MF)
 ///
 bool XCoreAsmPrinter::runOnMachineFunction(MachineFunction &MF)
 {
+  this->MF = &MF;
+
   SetupMachineFunction(MF);
 
   // Print out constants referenced by the function
index b3853044bb9c72aad6dec95bf1e3884d68396511..74ae3e0fcc525bc8b8cd24437db01791fa7e015a 100644 (file)
@@ -63,6 +63,6 @@ bool XCoreTargetMachine::addInstSelector(PassManagerBase &PM, bool Fast) {
 bool XCoreTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, 
                                             raw_ostream &Out) {
   // Output assembly language.
-  PM.add(createXCoreCodePrinterPass(Out, *this));
+  PM.add(createXCoreCodePrinterPass(Out, *this, Fast));
   return false;
 }
index 128b89363b6c0fe6ff5911d0dd81e54452cc8c92..e7fe8c369bd7174353246628539997c90a70378d 100644 (file)
@@ -641,9 +641,7 @@ void AsmWriterEmitter::run(std::ostream &O) {
   O << "\";\n\n";
 
   O << "  if (TAI->doesSupportDebugInformation() &&\n"
-    << "      DW->ShouldEmitDwarfDebug() &&\n"
-    << "      !DW->getFastCodeGen()) {\n"
-    << "    const MachineFunction *MF = MI->getParent()->getParent();\n"
+    << "      DW->ShouldEmitDwarfDebug() && !Fast) {\n"
     << "    DebugLoc CurDL = MI->getDebugLoc();\n\n"
     << "    if (!CurDL.isUnknown()) {\n"
     << "      static DebugLocTuple PrevDLT(~0U, ~0U, ~0U);\n"