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
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Diego Novillo <dnovillo at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, jason at redhat dot com
- Date: Tue, 29 Sep 2009 11:00:06 -0700
- Subject: Re: [LTO merge][4/15][RFA] C++ front end
- References: <20090929011238.GA12610@google.com>
Diego Novillo wrote:
> + if ((TREE_CODE (decl) == FUNCTION_DECL || TREE_CODE (decl) == VAR_DECL)
> + && DECL_LANG_SPECIFIC (decl)
> + && DECL_TEMPLATE_INFO (decl))
> + {
> + /* Templates do not need assembler names, only its instances. */
> + if (DECL_USE_TEMPLATE (decl) == 0)
> + return false;
Why isn't all this just:
if ((TREE_CODE (decl) == FUNCTION_DECL
|| TREE_CODE (decl) == VAR_DECL)
&& (DECL_TEMPLATE_INSTANTIATION (decl)
|| DECL_TEMPLATE_SPECIALIZATION (decl)))
? (That would be a more "logical" -- as opposed to "physical" --
check.) And does this hook get things that aren't variables or
functions? If so, why? (In an object file sense, variables and
functions are the only things that exist.)
> + /* Member friend templates do not need assembler names. */
> + if (TREE_CODE (DECL_TI_TEMPLATE (decl)) == IDENTIFIER_NODE
> + || TREE_CODE (DECL_TI_TEMPLATE (decl)) == OVERLOAD)
> + return false;
Do we want DECL_MEMBER_TEMPLATE_P here? Why is this hook seeing member
templates?
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713