Revert file/scope handling patches. gdb testing revealed a couple of bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141796 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index c56931b..06a045f 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -31,12 +31,11 @@
 
 void CodeGenFunction::EmitStopPoint(const Stmt *S) {
   if (CGDebugInfo *DI = getDebugInfo()) {
-    SourceLocation Loc;
     if (isa<DeclStmt>(S))
-      Loc = S->getLocEnd();
+      DI->setLocation(S->getLocEnd());
     else
-      Loc = S->getLocStart();
-    DI->EmitLocation(Builder, Loc);
+      DI->setLocation(S->getLocStart());
+    DI->EmitLocation(Builder);
   }
 }
 
@@ -191,8 +190,10 @@
                              "LLVM IR generation of compound statement ('{}')");
 
   CGDebugInfo *DI = getDebugInfo();
-  if (DI)
-    DI->EmitLexicalBlockStart(Builder, S.getLBracLoc());
+  if (DI) {
+    DI->setLocation(S.getLBracLoc());
+    DI->EmitLexicalBlockStart(Builder);
+  }
 
   // Keep track of the current cleanup stack depth.
   RunCleanupsScope Scope(*this);
@@ -201,8 +202,10 @@
        E = S.body_end()-GetLast; I != E; ++I)
     EmitStmt(*I);
 
-  if (DI)
-    DI->EmitLexicalBlockEnd(Builder, S.getRBracLoc());
+  if (DI) {
+    DI->setLocation(S.getRBracLoc());
+    DI->EmitLexicalBlockEnd(Builder);
+  }
 
   RValue RV;
   if (!GetLast)
@@ -567,8 +570,10 @@
   RunCleanupsScope ForScope(*this);
 
   CGDebugInfo *DI = getDebugInfo();
-  if (DI)
-    DI->EmitLexicalBlockStart(Builder, S.getSourceRange().getBegin());
+  if (DI) {
+    DI->setLocation(S.getSourceRange().getBegin());
+    DI->EmitLexicalBlockStart(Builder);
+  }
 
   // Evaluate the first part before the loop.
   if (S.getInit())
@@ -647,8 +652,10 @@
 
   ForScope.ForceCleanup();
 
-  if (DI)
-    DI->EmitLexicalBlockEnd(Builder, S.getSourceRange().getEnd());
+  if (DI) {
+    DI->setLocation(S.getSourceRange().getEnd());
+    DI->EmitLexicalBlockEnd(Builder);
+  }
 
   // Emit the fall-through block.
   EmitBlock(LoopExit.getBlock(), true);
@@ -660,8 +667,10 @@
   RunCleanupsScope ForScope(*this);
 
   CGDebugInfo *DI = getDebugInfo();
-  if (DI)
-    DI->EmitLexicalBlockStart(Builder, S.getSourceRange().getBegin());
+  if (DI) {
+    DI->setLocation(S.getSourceRange().getBegin());
+    DI->EmitLexicalBlockStart(Builder);
+  }
 
   // Evaluate the first pieces before the loop.
   EmitStmt(S.getRangeStmt());
@@ -717,8 +726,10 @@
 
   ForScope.ForceCleanup();
 
-  if (DI)
-    DI->EmitLexicalBlockEnd(Builder, S.getSourceRange().getEnd());
+  if (DI) {
+    DI->setLocation(S.getSourceRange().getEnd());
+    DI->EmitLexicalBlockEnd(Builder);
+  }
 
   // Emit the fall-through block.
   EmitBlock(LoopExit.getBlock(), true);