On Tue, Jun 12, 2012 at 9:36 AM, Diego Novillo <dnovi...@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