]> granicus.if.org Git - clang/commitdiff
Use end location of DeclStmt to mark stop point.
authorDevang Patel <dpatel@apple.com>
Wed, 12 May 2010 00:39:34 +0000 (00:39 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 12 May 2010 00:39:34 +0000 (00:39 +0000)
This is meaningful for blocks. This patch fixes bunch of test failures in gdb testsuite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103533 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGStmt.cpp

index a914c80da2aceec107b45100aad197af8d699816..772f640ed01f3828969cbfdd25aaee16471a63f1 100644 (file)
@@ -30,7 +30,10 @@ using namespace CodeGen;
 
 void CodeGenFunction::EmitStopPoint(const Stmt *S) {
   if (CGDebugInfo *DI = getDebugInfo()) {
-    DI->setLocation(S->getLocStart());
+    if (isa<DeclStmt>(S))
+      DI->setLocation(S->getLocEnd());
+    else
+      DI->setLocation(S->getLocStart());
     DI->EmitStopPoint(CurFn, Builder);
   }
 }