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
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);
}
}