Change CGDebugInfo::setLocation to just ignore invalid locations. This
simplifies clients.

Also, add assert that RegionStack is empty when the CGDebugInfo is
destroyed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57684 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index fed0eee..20312de 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -33,10 +33,7 @@
   // executable code. So do not generate a stoppoint for that.
   CGDebugInfo *DI = CGM.getDebugInfo();
   if (DI && S->getStmtClass() != Stmt::CompoundStmtClass) {
-    if (S->getLocStart().isValid()) {
-        DI->setLocation(S->getLocStart());
-    }
-
+    DI->setLocation(S->getLocStart());
     DI->EmitStopPoint(CurFn, Builder);
   }
 
@@ -122,8 +119,7 @@
   // FIXME: handle vla's etc.
   CGDebugInfo *DI = CGM.getDebugInfo();
   if (DI) {
-    if (S.getLBracLoc().isValid())
-      DI->setLocation(S.getLBracLoc());
+    DI->setLocation(S.getLBracLoc());
     DI->EmitRegionStart(CurFn, Builder);
   }
 
@@ -132,8 +128,7 @@
     EmitStmt(*I);
 
   if (DI) {
-    if (S.getRBracLoc().isValid())
-      DI->setLocation(S.getRBracLoc());
+    DI->setLocation(S.getRBracLoc());
     DI->EmitRegionEnd(CurFn, Builder);
   }