[PATCH] Fix line numbers for code inlined from __nodebug__ functions.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Wed Jun 4 11:11:20 PDT 2014


A normal function inlined into a __nodebug__ function will have some
of its instructions missing debug metadata.



On Wed, Jun 4, 2014 at 10:02 PM, David Blaikie <dblaikie at gmail.com> wrote:
> On Wed, Jun 4, 2014 at 10:56 AM, Eric Christopher <echristo at gmail.com> wrote:
>> On Wed, Jun 4, 2014 at 10:39 AM, David Blaikie <dblaikie at gmail.com> wrote:
>>> ================
>>> Comment at: test/Transforms/Inline/inline-line-numbers.ll:9
>>> @@ +8,3 @@
>>> +;   clang -S test.c -emit-llvm -O1 -gline-tables-only -fno-strict-aliasing
>>> +; and manually removing !dbg metadata from the first store instruction.
>>> +
>>> ----------------
>>> Evgeniy Stepanov wrote:
>>>> David Blaikie wrote:
>>>> > This seems a strange way to test this - I would've expected just a single assignment in "callee" and the nodebug attribute on it?
>>>> >
>>>> > Why two assignments and a manual modification to the metadata?
>>>> Because this way I'm testing a function that has instructions both with and without debug metadata. This is not the exact case we are interested in, but a more general one.
>>>>
>>> Why is that a scenario we need to test? When do we end up with a function both with and without debug metadata?
>>>
>>
>> Trivial one is for LTO of a module that's been compiled with debug
>> info and one that hasn't where a function from the one that wasn't is
>> inlined into one that has been.
>
> Presumably we would want to treat that the same as this patch does, I
> guess? In which case the inlined instructions would all be attributed
> to the call site, rather than being debug-less.
>
> - David
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list