Load and store debug information

Hi all,

I am currently looking for more accurate debug information.
In particular I am interested into relating load and store IR
instructions to the corresponding array subscript.
Current debug information associate each instruction to the source
code line they come from.
I would like to extend this, for loads and stores only, to make
metadata point to the
source location where the array subscript is.

I guess that this kind of debug information would be useful to provide
feedback to
the programmer about optimization opportunities, in particular in a
polyhedral framework.

Is this something reasonable to ask for ?
Is there any "easy" way to achieve this ?

One more thing.
Reading the documentation about source level debugging [1] I have noticed that
the IR snippet presented in "Object lifetimes and scoping" is not equivalent to
the corresponding piece of C code.

Thanks

Cheers,
Alberto

[1] http://llvm.org/docs/SourceLevelDebugging.html#format_common_lifetime

Hi all,

I am currently looking for more accurate debug information.
In particular I am interested into relating load and store IR
instructions to the corresponding array subscript.
Current debug information associate each instruction to the source
code line they come from.
I would like to extend this, for loads and stores only, to make
metadata point to the
source location where the array subscript is.

Is this something reasonable to ask for ?
Is there any "easy" way to achieve this ?

You could make the SrcLoc for the instruction match the array subscript instead
of the current location when generating debug information for that particular
expression, or perhaps add a SrcLoc for the GEP that's used to calculate the
offset. Just some ideas off the top of my head.

One more thing.
Reading the documentation about source level debugging [1] I have noticed that
the IR snippet presented in "Object lifetimes and scoping" is not equivalent to
the corresponding piece of C code.

Heh. Thanks.

-eric