[cfe-dev] Debug Info and Multi-Line statements (particularly "do" statements)

Peter Ohmann ohmann at cs.wisc.edu
Sat Jan 26 08:27:04 PST 2013


Bug #15076.

Thanks,
Peter


On Fri, Jan 25, 2013 at 6:41 PM, Eric Christopher <echristo at gmail.com>wrote:

>
>
>
> On Fri, Jan 25, 2013 at 3:42 PM, Richard Smith <richard at metafoo.co.uk>wrote:
>
>> On Fri, Jan 11, 2013 at 9:25 AM, Peter Ohmann <ohmann at cs.wisc.edu> wrote:
>> > Hello all,
>> >
>> > While I understand that debug data is best-effort, I am running into
>> some
>> > trouble with an analysis tool I'm building partially using an LLVM pass.
>> > There are two (seemingly directly related) cases where debug data is not
>> > missing (which wouldn't be a problem for me) but very misleading.
>> >
>> > First, in the case of multi-line statements, clang will assign the debug
>> > data for each expression to be the first line of the statement but
>> continue
>> > incrementing the column number past the number of columns on the line.
>>  The
>> > following code gives an example:
>> > [1] int foo(){
>> > [2]   int x, y, z;
>> > [3]   if(x < y ||
>> > [4]      y < z){
>> > [5]     x++;
>> > [6]   }
>> > [7] }
>> > In this example, when my LLVM pass gets the bitcode both the (x<y) and
>> (y<z)
>> > expressions are assigned DebugLocs which have line number 3 (but with
>> > increasing column numbers).
>>
>> When I try this, in the IR produced by 'clang -g', they both have line
>> 3 column 0. If I use 'clang -g -gcolumn-info', they both have line 3
>> column 3 (the location of the 'if' token). That seems to make somewhat
>> more sense, but is still probably not what we want.
>>
>
> Yeah, not so much.
>
> Peter: If you get a chance to file a bug in bugzilla so we can track it
> I'd appreciate it.
>
> Thanks!
>
> -eric
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130126/5207c648/attachment.html>


More information about the cfe-dev mailing list