On 12-06-12 11:58 , Sterling Augustine wrote: > +/* Wrap lang_decl_name with options appropriate for ...
12 years, 10 months ago
(2012-06-12 16:36:52 UTC)
#2
On 12-06-12 11:58 , Sterling Augustine wrote:
> +/* Wrap lang_decl_name with options appropriate for dwarf. */
> +
> +const char *
> +lang_decl_dwarf_name (tree decl, int v, bool translate)
> +{
> + const char *name;
> + /* Curiously, reinit_cxx_pp doesn't reset the flags field, so setting the
flag
> + here will be adequate to get the desired behaviour. */
> + pp_c_base (cxx_pp)->flags |= pp_c_flag_gnu_v3;
> + name = lang_decl_name (decl, v, translate);
> + /* Subsequent calls to the pretty printer shouldn't use this style. */
> + pp_c_base (cxx_pp)->flags&= ~pp_c_flag_gnu_v3;
> + return name;
> +}
Would it make sense to factor common code in decl_as_dwarf_string()?
OK, otherwise.
Diego.
On Tue, Jun 12, 2012 at 9:36 AM, Diego Novillo <dnovillo@google.com> wrote: > On 12-06-12 ...
12 years, 10 months ago
(2012-06-12 16:57:26 UTC)
#3
On Tue, Jun 12, 2012 at 9:36 AM, Diego Novillo <dnovillo@google.com> wrote:
> On 12-06-12 11:58 , Sterling Augustine wrote:
>
>> +/* Wrap lang_decl_name with options appropriate for dwarf. */
>> +
>> +const char *
>> +lang_decl_dwarf_name (tree decl, int v, bool translate)
>> +{
>> + const char *name;
>> + /* Curiously, reinit_cxx_pp doesn't reset the flags field, so setting
>> the flag
>> + here will be adequate to get the desired behaviour. */
>> + pp_c_base (cxx_pp)->flags |= pp_c_flag_gnu_v3;
>> + name = lang_decl_name (decl, v, translate);
>> + /* Subsequent calls to the pretty printer shouldn't use this style. */
>> + pp_c_base (cxx_pp)->flags&= ~pp_c_flag_gnu_v3;
>> + return name;
>> +}
>
>
> Would it make sense to factor common code in decl_as_dwarf_string()?
The wrapper code is the same, but the internal call is
not--"lang_decl_name" and "decl_as_string" return different strings,
and their interface is different so it wouldn't be easy to pass a
function pointer.
So, I'm not sure how you would combine the code without it getting more ugly.
Sterling
On 12-06-12 12:57 , Sterling Augustine wrote: > The wrapper code is the same, but ...
12 years, 10 months ago
(2012-06-12 16:58:51 UTC)
#4
On 12-06-12 12:57 , Sterling Augustine wrote:
> The wrapper code is the same, but the internal call is
> not--"lang_decl_name" and "decl_as_string" return different strings,
> and their interface is different so it wouldn't be easy to pass a
> function pointer.
>
> So, I'm not sure how you would combine the code without it getting more ugly.
Ah, you're right. I missed that. In any case, that's fine. The code
is short enough.
Thanks. Diego.
Issue 6297080: [Google 4.6] Backport C++ canonicalization patch
Created 12 years, 10 months ago by saugustine
Modified 12 years, 10 months ago
Reviewers: Diego Novillo
Base URL: svn+ssh://gcc.gnu.org/svn/gcc/branches/google/gcc-4_6/
Comments: 0