This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [LTO merge][4/15][RFA] C++ front end
On Wed, Sep 30, 2009 at 10:45, Jason Merrill <jason@redhat.com> wrote:
> This is entirely the wrong test; Mark suggested it because he didn't
> understand what you were asking for. ÂThis test finds decls that are related
> to templates, but doesn't discriminate between those that depend on template
> parameters and those which have all the template parameters replaced.
Oh, so just uses_template_parms should be enough?
>> What they all have in common is that they either depend on
>> template arguments or they are a template specialization.
>
> It shouldn't happen for full specializations, only for partial
> specializations (that still depend on template parms).
OK.
> But the question is, where are you getting these decls from? ÂWhat list do
> you find them on?
This is done during the very thorough symbol and type walk we do in
free_lang_data. We walk down every function body, every symbol, every
type, ... collecting symbols and types that should be cleared of
language-dependent information.
For all the VAR_DECL and FUNCTION_DECL symbols we find in this walk,
we check whether they will need to get an assembler name. We have to
do this at this point because we end up pulling the front end rug from
underneath all of them.
The central predicate that prevents assigning more assembler names
than necessary is tree.c:need_assembler_name_p. In the case of C++,
it needs this additional check for some decls that have template
information and should not be mangled.
Thanks. Diego.