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

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 28 16:59:33 PST 2016


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-commits <
cfe-commits at lists.llvm.org> wrote:

> 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 makes sense to visit 11.
>

oh, right... thanks for pointing that out. Sorry I missed it.


>
> > I think using the end of the condition is problematic/confusing. I'm not
> sure why this doesn't show up in the primitive value version, but it seems
> like it should (& we should end up stepping to the end of the condition
> (which would be the close paren of the function call, not the close paren
> of the 'if ()'))
>
>
> There is short-circuit in the primitive value version, so we wouldn't stop
> there.
>
> > Perhaps we should use the close paren of the 'if ()' but tehre's no
> source location for that readily available - I guess the way to get there
> is to navigate to the next token from the end of the condition
> expression... ?
>
>
> I agree, The close paren of the if() would be better.
>
>
> http://reviews.llvm.org/D8822
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160128/cb73b367/attachment.html>


More information about the cfe-commits mailing list