aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2018-11-07 11:13:15 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2018-11-07 10:13:15 +0000
commit36b56cd336f50d1565ecc4c5b1fed89151392baf (patch)
treeb47e3ad7ac8df205c1bec6823a750a2db425989a /gcc/tree.c
parent907050e34f4d1b5471e738cf5a718a8c6f50e334 (diff)
downloadgcc-36b56cd336f50d1565ecc4c5b1fed89151392baf.zip
gcc-36b56cd336f50d1565ecc4c5b1fed89151392baf.tar.gz
gcc-36b56cd336f50d1565ecc4c5b1fed89151392baf.tar.bz2
tree.c (free_lang_data_in_type): Add fld parameter; simplify return and parameter types of function and method types.
* tree.c (free_lang_data_in_type): Add fld parameter; simplify return and parameter types of function and method types. (free_lang_data_in_cgraph): Update. From-SVN: r265870
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index fcd001f..1436086 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5261,7 +5261,7 @@ free_lang_data_in_binfo (tree binfo)
/* Reset all language specific information still present in TYPE. */
static void
-free_lang_data_in_type (tree type)
+free_lang_data_in_type (tree type, struct free_lang_data_d *fld)
{
gcc_assert (TYPE_P (type));
@@ -5280,6 +5280,7 @@ free_lang_data_in_type (tree type)
if (TREE_CODE (type) == FUNCTION_TYPE)
{
+ TREE_TYPE (type) = fld_simplified_type (TREE_TYPE (type), fld);
/* Remove the const and volatile qualifiers from arguments. The
C++ front end removes them, but the C front end does not,
leading to false ODR violation errors when merging two
@@ -5287,6 +5288,7 @@ free_lang_data_in_type (tree type)
different front ends. */
for (tree p = TYPE_ARG_TYPES (type); p; p = TREE_CHAIN (p))
{
+ TREE_VALUE (p) = fld_simplified_type (TREE_VALUE (p), fld);
tree arg_type = TREE_VALUE (p);
if (TYPE_READONLY (arg_type) || TYPE_VOLATILE (arg_type))
@@ -5295,16 +5297,22 @@ free_lang_data_in_type (tree type)
& ~TYPE_QUAL_CONST
& ~TYPE_QUAL_VOLATILE;
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), fld);
}
/* C++ FE uses TREE_PURPOSE to store initial values. */
TREE_PURPOSE (p) = NULL;
}
}
else if (TREE_CODE (type) == METHOD_TYPE)
- for (tree p = TYPE_ARG_TYPES (type); p; p = TREE_CHAIN (p))
- /* C++ FE uses TREE_PURPOSE to store initial values. */
- TREE_PURPOSE (p) = NULL;
+ {
+ TREE_TYPE (type) = fld_simplified_type (TREE_TYPE (type), fld);
+ for (tree p = TYPE_ARG_TYPES (type); p; p = TREE_CHAIN (p))
+ {
+ /* C++ FE uses TREE_PURPOSE to store initial values. */
+ TREE_VALUE (p) = fld_simplified_type (TREE_VALUE (p), fld);
+ TREE_PURPOSE (p) = NULL;
+ }
+ }
else if (RECORD_OR_UNION_TYPE_P (type))
{
/* Remove members that are not FIELD_DECLs from the field list
@@ -5468,6 +5476,7 @@ free_lang_data_in_decl (tree decl, struct free_lang_data_d *fld)
if (TREE_CODE (decl) == FUNCTION_DECL)
{
struct cgraph_node *node;
+ TREE_TYPE (decl) = fld_simplified_type (TREE_TYPE (decl), fld);
if (!(node = cgraph_node::get (decl))
|| (!node->definition && !node->clones))
{
@@ -5985,7 +5994,7 @@ free_lang_data_in_cgraph (void)
/* Traverse every type found freeing its language data. */
FOR_EACH_VEC_ELT (fld.types, i, t)
- free_lang_data_in_type (t);
+ free_lang_data_in_type (t, &fld);
if (flag_checking)
{
FOR_EACH_VEC_ELT (fld.types, i, t)