[llvm] r192861 - Add the subprogram DIEs to the context they're created with only

Eric Christopher echristo at gmail.com
Thu Oct 24 16:59:29 PDT 2013


On Thu, Oct 24, 2013 at 4:45 PM, Eric Christopher <echristo at gmail.com>wrote:

>
>
>
> On Thu, Oct 24, 2013 at 4:30 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>>
>>  There are cases where we have a SP definition with a null declaration
>>>> field.
>>>>
>>>>
>>> Are you sure? Do you have an example?
>>>
>>
>> Non-member functions, such as this simple CU:
>>
>>   void func() {
>>   }
>>
>> produces DWARF with a subprogram list of one element, a DW_TAG_subprogram
>> of 'func' with a null declaration field.
>>
>
> Right, but it'll be added to the context of the CU below anyhow. Sorry, I
> was thinking "An example where the context isn't already the CU".
>
> That said, if the namespace and gnu-public-names tests pass after Manman's
> coming patches that rework this then it should be fine.
>
>
To elaborate a bit more, this could definitely use refactoring, however,
the current code is actually correct in that if we don't have a declaration
we'll fall through to the next set of code and immediate insert into the
context anyhow and I can't come up with a possible TU where we don't have a
declaration and yet have a definition that has a context other than the
compile unit.

That said, it's awkward and less than ideal. Conveniently for me Manman has
patches in flight that rework this area of code. :)

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131024/20b3ffcd/attachment.html>


More information about the llvm-commits mailing list