]> granicus.if.org Git - clang/commit
DebugInfo: Attribute implicit boolean tests to the expression being tested, not to...
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 28 Jan 2015 19:50:09 +0000 (19:50 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 28 Jan 2015 19:50:09 +0000 (19:50 +0000)
commit6993b070322ddf4d58219bb11e647975d077d2f0
treebb12e43b124c2b7facd90afdf38cc908b07d0bc3
parent09fb40a65de6407b8ec1e73add11619ea8d7b64b
DebugInfo: Attribute implicit boolean tests to the expression being tested, not to the outer use of that expression.

This is half a fix for a GDB test suite failure that expects to start at
'a' in the following code:

  void func(int a)
    if (a
        &&
b)
...

But instead, without this change, the comparison was assigned to '&&'
(well, worse actually - because there was a chained 'a && b && c' and it
was assigned to the second '&&' because of a recursive application of
this bug) and then the load folded into the comparison so breaking on
the function started at '&&' instead of 'a'.

The other part of this needs to be fixed in LLVM where it's ignoring the
location of the icmp and instead using the location of the branch
instruction.

The fix to the conditional operator is actually a no-op currently,
because the conditional operator's location coincides with 'a' (the
start of the conditional expression) but should probably be '?' instead.
See the FIXME in the test case that mentions the ARCMigration tool
failures when I tried to make that change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227356 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGDebugInfo.h
lib/CodeGen/CodeGenFunction.cpp
test/CodeGenCXX/debug-info-line.cpp