As the attributed statements are considered simple statements no
stoppoint was generated before emitting attributed do/while/for/range-
statement. This lead to faulty debug locations.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
test/CodeGen/debug-info-attributed-stmt.c | ||
---|---|---|
18 ↗ | (On Diff #113708) | The part "scope: !14)" should be removed from the testcase. |
I updated the testcase according to what David Blaikie suggested.
I also rewrote to code to be a bit more robust and avoid emitting unnecessary stoppoints.
Not sure what you mean by "avoid emitting unnecessary stop points" - do you have a test case for that?
In my previous patch you could end up doing two calls to EmitStopPoint() for the same statement. In the previous patch I added a EmitStopPoint() in the method EmitAttributedStmt(), but if you took the default clause in the switch statement in the same method you could end up executing another EmitStopPoint() in EmitStmt().
The new patch do not have the issue with executing EmitStopPoint() twice for the same statement. I think generally that the new patch is more robust solution.
test/CodeGen/debug-info-attributed-stmt.c | ||
---|---|---|
1 ↗ | (On Diff #113803) | Since we're not optimizing or generating code you should be able to remove the -disable-llvm-passes I believe. |
test/CodeGen/debug-info-attributed-stmt.c | ||
---|---|---|
1 ↗ | (On Diff #113803) | I added the option -disable-llvm-passes as David Blaikie suggested it in his original comment: |