Place dwarf headers at earliest possible point.  Well behaved when skipping
functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28781 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 8d520e7..44ab7f8 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -488,8 +488,9 @@
 /// method to print assembly for each instruction.
 ///
 bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
-  // FIXME - is this the earliest this can be set?
   DW.SetDebugInfo(&getAnalysis<MachineDebugInfo>());
+  // FIXME - should be able to debug coalesced functions.
+  bool IsNormalText = true;
 
   SetupMachineFunction(MF);
   O << "\n\n";
@@ -517,13 +518,14 @@
                 ".section __TEXT,__textcoal_nt,coalesced,pure_instructions", F);
     O << "\t.globl\t" << CurrentFnName << "\n";
     O << "\t.weak_definition\t" << CurrentFnName << "\n";
+    IsNormalText = false;
     break;
   }
   EmitAlignment(4, F);
   O << CurrentFnName << ":\n";
 
   // Emit pre-function debug information.
-  DW.BeginFunction(&MF);
+  DW.BeginFunction(&MF, IsNormalText);
 
   // Print out code for the function.
   for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();