Revert 71165. It did more than just revert 71158 and it introduced
several regressions. The problem due to 71158 is now fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71176 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index ec7aeb0..2205186 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -365,8 +365,7 @@
           BuildMI(MBB, DL, II).addImm(ID);
       } else {
         const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
-        ID =  DW->RecordRegionEnd(cast<GlobalVariable>(REI->getContext()),
-                                  Subprogram);
+        ID =  DW->RecordRegionEnd(cast<GlobalVariable>(REI->getContext()));
         BuildMI(MBB, DL, II).addImm(ID);
       }
     }
@@ -392,7 +391,6 @@
       // FIXME : Why DebugLoc is reset at the beginning of each block ?
       if (PrevLoc.isUnknown())
         return true;
-
       // Record the source line.
       unsigned Line = Subprogram.getLineNumber();
       setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(
@@ -412,10 +410,10 @@
       unsigned Line = Subprogram.getLineNumber();
       MF.setDefaultDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(
                                               CompileUnit.getGV(), Line, 0)));
-
-      if (DW && DW->ShouldEmitDwarfDebug())
+      if (DW && DW->ShouldEmitDwarfDebug()) {
         // llvm.dbg.func_start also defines beginning of function scope.
         DW->RecordRegionStart(cast<GlobalVariable>(FSI->getSubprogram()));
+      }
     }
 
     return true;