aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index f00a519b302..c3ac8f36d55 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -5240,7 +5240,7 @@ need_assembler_name_p (tree decl)
{
/* Do not set assembler name on builtins. Allow RTL expansion to
decide whether to expand inline or via a regular call. */
- if (DECL_BUILT_IN (decl)
+ if (fndecl_built_in_p (decl)
&& DECL_BUILT_IN_CLASS (decl) != BUILT_IN_FRONTEND)
return false;
@@ -5339,12 +5339,7 @@ free_lang_data_in_decl (tree decl)
(DECL_CONTEXT (DECL_ABSTRACT_ORIGIN (decl))))
DECL_ABSTRACT_ORIGIN (decl) = NULL_TREE;
- /* Sometimes the C++ frontend doesn't manage to transform a temporary
- DECL_VINDEX referring to itself into a vtable slot number as it
- should. Happens with functions that are copied and then forgotten
- about. Just clear it, it won't matter anymore. */
- if (DECL_VINDEX (decl) && !tree_fits_shwi_p (DECL_VINDEX (decl)))
- DECL_VINDEX (decl) = NULL_TREE;
+ DECL_VINDEX (decl) = NULL_TREE;
}
else if (VAR_P (decl))
{
@@ -5371,10 +5366,9 @@ free_lang_data_in_decl (tree decl)
nodes and thus we can't use TREE_CHAIN in multiple lists. */
tree *nextp = &BLOCK_VARS (DECL_INITIAL (decl));
while (*nextp)
- {
- tree var = *nextp;
- if (TREE_CODE (var) == FUNCTION_DECL
- && DECL_BUILT_IN (var))
+ {
+ tree var = *nextp;
+ if (fndecl_built_in_p (var))
*nextp = TREE_CHAIN (var);
else
nextp = &TREE_CHAIN (var);
@@ -5525,9 +5519,14 @@ find_decls_types_r (tree *tp, int *ws, void *data)
fld_worklist_push (TYPE_POINTER_TO (t), fld);
fld_worklist_push (TYPE_REFERENCE_TO (t), fld);
fld_worklist_push (TYPE_NAME (t), fld);
- /* Do not walk TYPE_NEXT_PTR_TO or TYPE_NEXT_REF_TO. We do not stream
- them and thus do not and want not to reach unused pointer types
- this way. */
+ /* While we do not stream TYPE_POINTER_TO and TYPE_REFERENCE_TO
+ lists, we may look types up in these lists and use them while
+ optimizing the function body. Thus we need to free lang data
+ in them. */
+ if (TREE_CODE (t) == POINTER_TYPE)
+ fld_worklist_push (TYPE_NEXT_PTR_TO (t), fld);
+ if (TREE_CODE (t) == REFERENCE_TYPE)
+ fld_worklist_push (TYPE_NEXT_REF_TO (t), fld);
if (!POINTER_TYPE_P (t))
fld_worklist_push (TYPE_MIN_VALUE_RAW (t), fld);
/* TYPE_MAX_VALUE_RAW is TYPE_BINFO for record types. */
@@ -8990,7 +8989,7 @@ decl_function_context (const_tree decl)
C++ should really be fixed to use DECL_CONTEXT for the real context,
and use something else for the "virtual context". */
- else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VINDEX (decl))
+ else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VIRTUAL_P (decl))
context
= TYPE_MAIN_VARIANT
(TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl)))));
@@ -9100,7 +9099,7 @@ get_call_combined_fn (const_tree call)
return as_combined_fn (CALL_EXPR_IFN (call));
tree fndecl = get_callee_fndecl (call);
- if (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
+ if (fndecl && fndecl_built_in_p (fndecl, BUILT_IN_NORMAL))
return as_combined_fn (DECL_FUNCTION_CODE (fndecl));
return CFN_LAST;