aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/gigi.h
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2009-09-24 13:36:24 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2009-09-24 13:36:24 +0000
commit3f13dd777c1c0f76000172eb4426ccea1fd4d79d (patch)
treec8a62fd130fec7119d983c7798a5e73a7f612bdb /gcc/ada/gcc-interface/gigi.h
parent6356f38faf789f0095575a9258f8d459917f7363 (diff)
downloadgcc-3f13dd777c1c0f76000172eb4426ccea1fd4d79d.zip
gcc-3f13dd777c1c0f76000172eb4426ccea1fd4d79d.tar.gz
gcc-3f13dd777c1c0f76000172eb4426ccea1fd4d79d.tar.bz2
ada.h: Fix outdated comment.
* gcc-interface/ada.h: Fix outdated comment. * gcc-interface/ada-tree.h (SET_TYPE_RM_VALUE): Use MARK_VISITED in lieu of mark_visited. * gcc-interface/gigi.h (mark_visited): Change type of parameter. (MARK_VISITED): New macro. (gnat_truthvalue_conversion): Delete. * gcc-interface/decl.c (gnat_to_gnu_entity): Use MARK_VISITED in lieu of mark_visited. (annotate_rep): Fix formatting and tidy. (compute_field_positions): Get rid of useless variable. * gcc-interface/trans.c (gnat_to_gnu): Retrieve the Nkind of the GNAT node only once. Use IN operator for the Nkind in more cases. Remove calls to gnat_truthvalue_conversion. (mark_visited): Change type of parameter and adjust. (mark_visited_r): Dereference TP only once. (add_decl_expr): Use MARK_VISITED in lieu of mark_visited. * gcc-interface/utils2.c (gnat_truthvalue_conversion): Delete. (build_binary_op): Remove calls to gnat_truthvalue_conversion. (build_unary_op): Likewise. From-SVN: r152121
Diffstat (limited to 'gcc/ada/gcc-interface/gigi.h')
-rw-r--r--gcc/ada/gcc-interface/gigi.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/gcc/ada/gcc-interface/gigi.h b/gcc/ada/gcc-interface/gigi.h
index a6171b2..fe91cf3 100644
--- a/gcc/ada/gcc-interface/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -75,10 +75,19 @@ extern void set_block_for_group (tree);
Get SLOC from GNAT_ENTITY. */
extern void add_decl_expr (tree gnu_decl, Entity_Id gnat_entity);
-/* Mark nodes rooted at *TP with TREE_VISITED and types as having their
+/* Mark nodes rooted at T with TREE_VISITED and types as having their
sized gimplified. We use this to indicate all variable sizes and
positions in global types may not be shared by any subprogram. */
-extern void mark_visited (tree *tp);
+extern void mark_visited (tree t);
+
+/* This macro calls the above function but short-circuits the common
+ case of a constant to save time and also checks for NULL. */
+
+#define MARK_VISITED(EXP) \
+do { \
+ if((EXP) && !TREE_CONSTANT (EXP)) \
+ mark_visited (EXP); \
+} while (0)
/* Finalize any From_With_Type incomplete types. We do this after processing
our compilation unit and after processing its spec, if this is a body. */
@@ -767,20 +776,6 @@ extern bool is_double_scalar_or_array (Entity_Id gnat_type,
component of an aggregate type. */
extern bool type_for_nonaliased_component_p (tree gnu_type);
-/* Prepare expr to be an argument of a TRUTH_NOT_EXPR or other logical
- operation.
-
- This preparation consists of taking the ordinary
- representation of an expression EXPR and producing a valid tree
- boolean expression describing whether EXPR is nonzero. We could
- simply always do build_binary_op (NE_EXPR, expr, integer_zero_node, 1),
- but we optimize comparisons, &&, ||, and !.
-
- The resulting type should always be the same as the input type.
- This function is simpler than the corresponding C version since
- the only possible operands will be things of Boolean type. */
-extern tree gnat_truthvalue_conversion (tree expr);
-
/* Return the base type of TYPE. */
extern tree get_base_type (tree type);