- Emit subsections_via_symbols for Darwin.
- Conditionalize Dwarf debugging output (Darwin only for now).

llvm-svn: 26582
diff --git a/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp b/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
index e50100e..f1b53fd 100755
--- a/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
@@ -27,15 +27,19 @@
 /// method to print assembly for each instruction.
 ///
 bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
-  // Let PassManager know we need debug information and relay
-  // the MachineDebugInfo address on to DwarfWriter.
-  DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
+  //  if (forDarwin) {
+    // Let PassManager know we need debug information and relay
+    // the MachineDebugInfo address on to DwarfWriter.
+    DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
+    //  }
 
   SetupMachineFunction(MF);
   O << "\n\n";
 
-  // Emit pre-function debug information.
-  DW.BeginFunction(MF);
+  if (forDarwin) {
+    // Emit pre-function debug information.
+    DW.BeginFunction(MF);
+  }
 
   // Print out constants referenced by the function
   EmitConstantPool(MF.getConstantPool());
@@ -88,8 +92,10 @@
   if (HasDotTypeDotSizeDirective)
     O << "\t.size " << CurrentFnName << ", .-" << CurrentFnName << "\n";
 
-  // Emit post-function debug information.
-  DW.EndFunction(MF);
+  if (forDarwin) {
+    // Emit post-function debug information.
+    DW.EndFunction(MF);
+  }
 
   // We didn't modify anything.
   return false;