module.cc (trees_out::tree_decl): Adjust TEMPLATE_INFO access.

gcc/cp/
	* module.cc (trees_out::tree_decl): Adjust TEMPLATE_INFO access.

From-SVN: r267139
This commit is contained in:
Nathan Sidwell
2018-12-14 18:46:13 +00:00
committed by Nathan Sidwell
parent 6b4442fd28
commit 82faacf1c7
2 changed files with 18 additions and 11 deletions

View File

@@ -1,3 +1,8 @@
2018-12-14 Nathan Sidwell <nathan@acm.org>
gcc/cp/
* module.cc (trees_out::tree_decl): Adjust TEMPLATE_INFO access.
2018-12-13 Nathan Sidwell <nathan@acm.org>
Function template deduping

View File

@@ -6138,22 +6138,24 @@ trees_out::tree_decl (tree decl, walk_kind ref, bool looking_inside)
const char *kind = NULL;
tree ti = NULL_TREE;
int use_tpl = -1;
if ((TREE_CODE (decl) == FUNCTION_DECL
|| TREE_CODE (decl) == VAR_DECL
|| TREE_CODE (decl) == TYPE_DECL)
&& DECL_LANG_SPECIFIC (decl))
if (DECL_IMPLICIT_TYPEDEF_P (decl))
{
tree type = TREE_TYPE (decl);
if (TYPE_LANG_SPECIFIC (type))
{
ti = TYPE_TEMPLATE_INFO (type);
use_tpl = CLASSTYPE_USE_TEMPLATE (type);
}
}
else if (DECL_LANG_SPECIFIC (decl)
&& (TREE_CODE (decl) == FUNCTION_DECL
|| TREE_CODE (decl) == VAR_DECL
|| TREE_CODE (decl) == TYPE_DECL))
{
use_tpl = DECL_USE_TEMPLATE (decl);
ti = DECL_TEMPLATE_INFO (decl);
}
if (!ti && TREE_CODE (decl) == TYPE_DECL
&& TYPE_LANG_SPECIFIC (TREE_TYPE (decl)))
{
ti = TYPE_TEMPLATE_INFO (TREE_TYPE (decl));
use_tpl = CLASSTYPE_USE_TEMPLATE (TREE_TYPE (decl));
}
unsigned owner = MODULE_UNKNOWN;
if (!ti)
;