aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/utils.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2017-09-05 09:02:07 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2017-09-05 09:02:07 +0000
commit7ed9919dff52443091071203bf93685cf78002a3 (patch)
treeb6bac242e9f042c2132f09593100f19d1ca16cc3 /gcc/ada/gcc-interface/utils.c
parent806fcf7183377c7df062a7fa0bcf9d0ce8ea1fc0 (diff)
downloadgcc-7ed9919dff52443091071203bf93685cf78002a3.zip
gcc-7ed9919dff52443091071203bf93685cf78002a3.tar.gz
gcc-7ed9919dff52443091071203bf93685cf78002a3.tar.bz2
gigi.h (renaming_from_generic_instantiation_p): Turn to
* gcc-interface/gigi.h (renaming_from_generic_instantiation_p): Turn to (renaming_from_instantiation_p): ...this. * gcc-interface/decl.c (gnat_to_gnu_entity): Use inline predicate instead of explicit tests on kind of entities. Adjust for renaming. (gnat_to_gnu_profile_type): Likewise. (gnat_to_gnu_subprog_type): Likewise. * gcc-interface/trans.c (Identifier_to_gnu): Likewise. (Case_Statement_to_gnu): Likewise. (gnat_to_gnu): Likewise. (process_freeze_entity): Likewise. (process_type): Likewise. (add_stmt_with_node): Adjust for renaming. * gcc-interface/utils.c (gnat_pushdecl): Adjust for renaming. (renaming_from_generic_instantiation_p): Rename to... (renaming_from_instantiation_p): ...this. Use inline predicate. (pad_type_hasher::keep_cache_entry): Fold. From-SVN: r251700
Diffstat (limited to 'gcc/ada/gcc-interface/utils.c')
-rw-r--r--gcc/ada/gcc-interface/utils.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/gcc/ada/gcc-interface/utils.c b/gcc/ada/gcc-interface/utils.c
index 9510898..b0f6d2d 100644
--- a/gcc/ada/gcc-interface/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -231,11 +231,15 @@ struct pad_type_hasher : ggc_cache_ptr_hash<pad_type_hash>
{
static inline hashval_t hash (pad_type_hash *t) { return t->hash; }
static bool equal (pad_type_hash *a, pad_type_hash *b);
- static int keep_cache_entry (pad_type_hash *&);
+
+ static int
+ keep_cache_entry (pad_type_hash *&t)
+ {
+ return ggc_marked_p (t->type);
+ }
};
-static GTY ((cache))
- hash_table<pad_type_hasher> *pad_type_hash_table;
+static GTY ((cache)) hash_table<pad_type_hasher> *pad_type_hash_table;
static tree merge_sizes (tree, tree, tree, bool, bool);
static tree fold_bit_position (const_tree);
@@ -750,7 +754,7 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
TREE_NO_WARNING (decl) = (No (gnat_node) || Warnings_Off (gnat_node));
/* Set the location of DECL and emit a declaration for it. */
- if (Present (gnat_node) && !renaming_from_generic_instantiation_p (gnat_node))
+ if (Present (gnat_node) && !renaming_from_instantiation_p (gnat_node))
Sloc_to_locus (Sloc (gnat_node), &DECL_SOURCE_LOCATION (decl));
add_decl_expr (decl, gnat_node);
@@ -1192,14 +1196,6 @@ make_type_from_size (tree type, tree size_tree, bool for_biased)
return type;
}
-/* See if the data pointed to by the hash table slot is marked. */
-
-int
-pad_type_hasher::keep_cache_entry (pad_type_hash *&t)
-{
- return ggc_marked_p (t->type);
-}
-
/* Return true iff the padded types are equivalent. */
bool
@@ -2899,10 +2895,10 @@ value_factor_p (tree value, HOST_WIDE_INT factor)
initialization is likely to disturb debugging. */
bool
-renaming_from_generic_instantiation_p (Node_Id gnat_node)
+renaming_from_instantiation_p (Node_Id gnat_node)
{
if (Nkind (gnat_node) != N_Defining_Identifier
- || !IN (Ekind (gnat_node), Object_Kind)
+ || !Is_Object (gnat_node)
|| Comes_From_Source (gnat_node)
|| !Present (Renamed_Object (gnat_node)))
return false;