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: [LTO merge][4/15][RFA] C++ front end


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


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