This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] C++/DWARF : Add 'using' support


On Fri, 12 Dec 2003 10:43:49 -0800, Devang Patel <dpatel@apple.com> wrote:

> On Dec 11, 2003, at 10:31 PM, Jason Merrill wrote:
>
>> On Thu, 11 Dec 2003 18:01:05 -0800, Devang Patel <dpatel@apple.com> wrote:
>>
>>> !   debug_true_tree,		/* ignore_block */
>>> --- 382,406 ----
>>> !   debug_true_tree,		         /* ignore_block */
>>
>> Don't reformat these lines.
>
> I reformatted these lines so that all comments' start column is aligned
> properly.

Fair enough.  But now that I think about it, the new function should take
the enum, not an unsigned int.

>>>         /* Otherwise we're emitting the primary DIE for this decl.  */
>>> !       else if (debug_info_level > DINFO_LEVEL_TERSE)
>>> --- 11976,12005 ----
>>>         /* Otherwise we're emitting the primary DIE for this decl.  */
>>> !       else
>>> ! 	{
>>> ! 	  if (debug_info_level > DINFO_LEVEL_TERSE)
>>
>> More gratuitous reformatting.
>
> here I am including gen_subprogram_die() call inside else { ... } because
> dwarf2out_abstract_function() will do it for earlier cases.

dwarf2out_abstract_function emits the abstract instance, and then
gen_subprogram_die emits the concrete instance which refers to the abstract
instance.  That's how it's supposed to work.

>>> +       /* Setup namespace for the variable.  */
>>> +       context_die = setup_namespace_context (decl, context_die);
>>
>> This is probably left over from when you were working with Dan's patch.
>> It doesn't belong.
>
> I need it for r1 in  this case:
>
>    namespace R
>    {
>      int r1 = 19;
>    }
>    using R::r1;

You shouldn't need it.  In any case, it's wrong; we only want to declare r1
in R, but define it outside.  That's why I changed these bits to use
declare_in_namespace instead.

>>> +   /* Use original type for TYPE_DECL.  */
>>
>> That seems wrong.  If we're using a typedef, presumably we want the
>> imported declaration to have the same name.
>
> But in gen_typedef_die() we equate original type to die.

No, we don't.  We give it an AT_type which refers to the original type, but
we equate it with its TREE_TYPE.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]