Commit 15296d46 by Jan Hubicka Committed by Jan Hubicka

tree.c (free_lang_data_in_type): Free TREE_PURPOSE of TYPE_ARG_TYPES list.

	* tree.c (free_lang_data_in_type): Free TREE_PURPOSE of
	TYPE_ARG_TYPES list.
	(verify_type): Permit non-NULL TREE_PURPOSE in non-LTO builds.
	* tree.def (FUNCTION_TYPE): Document TREE_PURPOSE in TYPE_ARG_TYPES

From-SVN: r222984
parent e587377d
2015-05-09 Jan Hubicka <hubicka@ucw.cz> 2015-05-09 Jan Hubicka <hubicka@ucw.cz>
* tree.c (free_lang_data_in_type): Free TREE_PURPOSE of
TYPE_ARG_TYPES list.
(verify_type): Permit non-NULL TREE_PURPOSE in non-LTO builds.
* tree.def (FUNCTION_TYPE): Document TREE_PURPOSE in TYPE_ARG_TYPES
2015-05-09 Jan Hubicka <hubicka@ucw.cz>
* tree.c (verify_type): Verify TYPE_BINFO and TYPE_VALUES_RAW. * tree.c (verify_type): Verify TYPE_BINFO and TYPE_VALUES_RAW.
* tree.h (is_lang_specific): Constify. * tree.h (is_lang_specific): Constify.
......
...@@ -5041,7 +5041,23 @@ free_lang_data_in_type (tree type) ...@@ -5041,7 +5041,23 @@ free_lang_data_in_type (tree type)
TREE_VALUE (p) = build_qualified_type (arg_type, quals); TREE_VALUE (p) = build_qualified_type (arg_type, quals);
free_lang_data_in_type (TREE_VALUE (p)); free_lang_data_in_type (TREE_VALUE (p));
} }
/* C++ FE uses TREE_PURPOSE to store initial values. */
TREE_PURPOSE (p) = NULL;
} }
/* Java uses TYPE_MINVAL for TYPE_ARGUMENT_SIGNATURE. */
TYPE_MINVAL (type) = NULL;
}
if (TREE_CODE (type) == METHOD_TYPE)
{
tree p;
for (p = TYPE_ARG_TYPES (type); p; p = TREE_CHAIN (p))
{
/* C++ FE uses TREE_PURPOSE to store initial values. */
TREE_PURPOSE (p) = NULL;
}
/* Java uses TYPE_MINVAL for TYPE_ARGUMENT_SIGNATURE. */
TYPE_MINVAL (type) = NULL;
} }
/* Remove members that are not actually FIELD_DECLs from the field /* Remove members that are not actually FIELD_DECLs from the field
...@@ -12619,13 +12635,18 @@ verify_type (const_tree t) ...@@ -12619,13 +12635,18 @@ verify_type (const_tree t)
error_found = true; error_found = true;
} }
} }
else if (INTEGRAL_TYPE_P (t) || TREE_CODE (t) == REAL_TYPE || TREE_CODE (t) == FIXED_POINT_TYPE) else if (INTEGRAL_TYPE_P (t) || TREE_CODE (t) == REAL_TYPE
|| TREE_CODE (t) == FIXED_POINT_TYPE)
{ {
/* FIXME: The following check should pass: /* FIXME: The following check should pass:
useless_type_conversion_p (const_cast <tree> (t), TREE_TYPE (TYPE_MIN_VALUE (t)) useless_type_conversion_p (const_cast <tree> (t),
TREE_TYPE (TYPE_MIN_VALUE (t))
but does not for C sizetypes in LTO. */ but does not for C sizetypes in LTO. */
} }
else if (TYPE_MINVAL (t)) /* Java uses TYPE_MINVAL for TYPE_ARGUMENT_SIGNATURE. */
else if (TYPE_MINVAL (t)
&& ((TREE_CODE (t) != METHOD_TYPE && TREE_CODE (t) != FUNCTION_TYPE)
|| in_lto_p))
{ {
error ("TYPE_MINVAL non-NULL"); error ("TYPE_MINVAL non-NULL");
debug_tree (TYPE_MINVAL (t)); debug_tree (TYPE_MINVAL (t));
...@@ -12665,10 +12686,12 @@ verify_type (const_tree t) ...@@ -12665,10 +12686,12 @@ verify_type (const_tree t)
error_found = true; error_found = true;
} }
} }
else if (INTEGRAL_TYPE_P (t) || TREE_CODE (t) == REAL_TYPE || TREE_CODE (t) == FIXED_POINT_TYPE) else if (INTEGRAL_TYPE_P (t) || TREE_CODE (t) == REAL_TYPE
|| TREE_CODE (t) == FIXED_POINT_TYPE)
{ {
/* FIXME: The following check should pass: /* FIXME: The following check should pass:
useless_type_conversion_p (const_cast <tree> (t), TREE_TYPE (TYPE_MAX_VALUE (t)) useless_type_conversion_p (const_cast <tree> (t),
TREE_TYPE (TYPE_MAX_VALUE (t))
but does not for C sizetypes in LTO. */ but does not for C sizetypes in LTO. */
} }
else if (TREE_CODE (t) == ARRAY_TYPE) else if (TREE_CODE (t) == ARRAY_TYPE)
...@@ -12817,7 +12840,8 @@ verify_type (const_tree t) ...@@ -12817,7 +12840,8 @@ verify_type (const_tree t)
else if (TREE_CODE (t) == FUNCTION_TYPE || TREE_CODE (t) == METHOD_TYPE) else if (TREE_CODE (t) == FUNCTION_TYPE || TREE_CODE (t) == METHOD_TYPE)
for (tree l = TYPE_ARG_TYPES (t); l; l = TREE_CHAIN (l)) for (tree l = TYPE_ARG_TYPES (t); l; l = TREE_CHAIN (l))
{ {
if (TREE_PURPOSE (l)) /* C++ FE uses TREE_PURPOSE to store initial values. */
if (TREE_PURPOSE (l) && in_lto_p)
{ {
error ("TREE_PURPOSE is non-NULL in TYPE_ARG_TYPES list"); error ("TREE_PURPOSE is non-NULL in TYPE_ARG_TYPES list");
debug_tree (l); debug_tree (l);
......
...@@ -245,6 +245,8 @@ DEFTREECODE (POINTER_BOUNDS_TYPE, "pointer_bounds_type", tcc_type, 0) ...@@ -245,6 +245,8 @@ DEFTREECODE (POINTER_BOUNDS_TYPE, "pointer_bounds_type", tcc_type, 0)
TREE_TYPE type of value returned. TREE_TYPE type of value returned.
TYPE_ARG_TYPES list of types of arguments expected. TYPE_ARG_TYPES list of types of arguments expected.
this list is made of TREE_LIST nodes. this list is made of TREE_LIST nodes.
In this list TREE_PURPOSE can be used to indicate the default
value of parameter (used by C++ frontend).
Types of "Procedures" in languages where they are different from functions Types of "Procedures" in languages where they are different from functions
have code FUNCTION_TYPE also, but then TREE_TYPE is zero or void type. */ have code FUNCTION_TYPE also, but then TREE_TYPE is zero or void type. */
DEFTREECODE (FUNCTION_TYPE, "function_type", tcc_type, 0) DEFTREECODE (FUNCTION_TYPE, "function_type", tcc_type, 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment