diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-08-15 20:50:45 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-08-15 20:50:45 +0000 |
commit | 15c4956b3a05374c2b63cd2f47f4217b721ff4d0 (patch) | |
tree | 45e422d53d92ff7b521ac6c7cdff81bef6743586 /clang/test/CodeGenCXX/debug-info-line-if.cpp | |
parent | 3931c28b031c08bc1880b43ef5f530dae81b9b06 (diff) | |
download | bcm5719-llvm-15c4956b3a05374c2b63cd2f47f4217b721ff4d0.tar.gz bcm5719-llvm-15c4956b3a05374c2b63cd2f47f4217b721ff4d0.zip |
DebugInfo: Fix PR19864 better - attribute the jump at the end of a range-for loop, to the start of the loop.
This avoids debuggers stepping to strange places (like the last
statement in the loop body, or the first statement in the if).
This is not the whole answer, though - similar bugs no doubt exist in
other loops (patches to follow) and attributing exception handling code
to the correct line is also tricky (based on the previous fix to
PR19864, exception handling is still erroneously attributed to the 'if'
line).
llvm-svn: 215766
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info-line-if.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/debug-info-line-if.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-line-if.cpp b/clang/test/CodeGenCXX/debug-info-line-if.cpp index e14090f03f9..068e2a4a8c5 100644 --- a/clang/test/CodeGenCXX/debug-info-line-if.cpp +++ b/clang/test/CodeGenCXX/debug-info-line-if.cpp @@ -9,12 +9,12 @@ int main() { else if (x >= 0) ++a; // CHECK: add nsw{{.*}}, 1 // The continuation block if the if statement should not share the - // location of the ++a statement. Having it point to the end of - // the condition is not ideal either, but it's less missleading. + // location of the ++a statement. The branch back to the start of the loop + // should be attributed to the loop header line. // CHECK: br label // CHECK: br label // CHECK: br label {{.*}}, !dbg ![[DBG:.*]] - // CHECK: ![[DBG]] = metadata !{i32 [[@LINE-11]], i32 0, metadata !{{.*}}, null} + // CHECK: ![[DBG]] = metadata !{i32 [[@LINE-12]], i32 0, metadata !{{.*}}, null} } |