Re: [PATCH] D8822: Proposed fix for PR23076 (conditional branch debug line info)

2016-01-28 Thread David Blaikie via cfe-commits
Richard Smith: Is there a reasonable way to get the ')' of an "if ()" expression in the AST? Is it just a matter of going down and playing games with source locations/lexing to get the token after the end location of the condition expression? On Thu, Jan 28, 2016 at 4:57 PM, Wolfgang Pieb via cfe-

Re: [PATCH] D8822: Proposed fix for PR23076 (conditional branch debug line info)

2016-01-28 Thread Wolfgang Pieb via cfe-commits
wolfgangp added a comment. > Clang (with patch) > 3, 5, 4, 5, 7 > 9, 11, 10, 11, 14 > > So that's somewhat problematic - we shouldn't visit 11 at all. (but we are > today, as is GCC... so maybe NBD?) Well, if op&& is overloaded, wouldn't we lose the short-circuit property? If so it ma

Re: [PATCH] D8822: Proposed fix for PR23076 (conditional branch debug line info)

2016-01-27 Thread David Blaikie via cfe-commits
dblaikie added a comment. Fair question on overloaded operators... Taking the original code: 1: int main() { 2: if ( 3: tr() 4: && 5: tr() 6: ) 7: func(); 8: if ( 9: fa() 10: && 11: tr() 12: ) 13: func(); 14: } & making tr/fa return a user defined type with a

Re: [PATCH] D8822: Proposed fix for PR23076 (conditional branch debug line info)

2016-01-22 Thread Adrian Prantl via cfe-commits
aprantl added a comment. The linetable produced by GCC appears to be the most accurate one (stopping at the && for the short-circuit evaluation and then returning there for the actual & and the branch). I would not have a problem with clang implementing it. The downside of it is that it breaks t

Re: [PATCH] D8822: Proposed fix for PR23076 (conditional branch debug line info)

2016-01-19 Thread Adrian Prantl via cfe-commits
aprantl added a subscriber: aprantl. aprantl added a comment. Reposting dblaikie's example hoping that phabricator doesn't mangle it this time: 1: int main() { 2: if ( 3: tr() 4: && 5: tr() 6: ) 7: func(); 8: if ( 9: fa() 10: && 11: tr() 12: ) 13: func(); 14:

Re: [PATCH] D8822: Proposed fix for PR23076 (conditional branch debug line info)

2016-01-15 Thread David Blaikie via cfe-commits
dblaikie added a subscriber: dblaikie. dblaikie added a comment. Apologies for the massively delayed review. I think this is probably good, but here are some test cases to discuss (& I've cc'd Paul Robinson and Adrian Prantl, both who work on debug info in LLVM as well, to get their thoughts) Giv