This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] C++/DWARF : Add 'using' support - take 2
On Tue, 13 Jan 2004 14:54:37 -0800, Devang Patel <dpatel@apple.com> wrote:
> On Jan 13, 2004, at 2:32 PM, Jason Merrill wrote:
>
>>>> I'd prefer to do without all the changes to make gen_subprogram_die
>>>> return a value. I don't see a good reason to break the convention of
>>>> "generate, then look up" for just this one variety of DIE.
>>>
>>> We do not equate abstract dies with decl number
>>
>> Huh?
>
> Oops, I gave wrong reason. We do not equate declaration dies unless
> it is for abstract functions.
Then we should. Previously there was no reason to look up the die for a
function except for DW_AT_abstract_origin or DW_AT_specification; now there
is.
>>>> You should handle this in the "else if (old_die)" block below, which
>>>> also deals with reusing a die.
>>>
>>> It handles reusing decl die as definition die. We need to complete this
>>> die which is the else section after "else if (old_die)".
>>
>> What do you mean by "complete"? The die created by force_decl_die should
>> be a declaration die, so reusing it as a definition die should be what we
>> want.
>
> We also force abstract function dies.
But I don't think we should, as discussed later in my message.
>>>> I don't see how checking die_definition makes any sense here. What
>>>> situation is this code trying to handle?
>>>
>>> If variable for forced out earlier than later on add_AT_specification()
>>> aborts because die_definition is non-zero.
>>
>> Why is it non-zero?
>
> Because die for variable is already forced out. I just need a check
> to skip it next time.
This would also be fixed by making the forced DIE a declaration.
>> I think we want to force a declaration die in all cases, regardless of
>> whether or not the function has been defined. I'm reluctant to change the
>> order in which definition dies are emitted.
>
> I think, I tried that but did not work out well for inlines hence
> you suggested to emit die to represent abstract function. Anyway, I'll
> give it another shot.
Thanks.
Jason