aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2002-03-25 19:11:13 +0000
committerNeil Booth <neil@gcc.gnu.org>2002-03-25 19:11:13 +0000
commitc88770e9dfa1b4c4175e39a3a62264c8bcb0043b (patch)
tree3fdcb23609c1c0e4600afc58d41d0dd3ea750b9b
parent2188d04d141f87189c987a31a62758f57cb64af8 (diff)
downloadgcc-c88770e9dfa1b4c4175e39a3a62264c8bcb0043b.zip
gcc-c88770e9dfa1b4c4175e39a3a62264c8bcb0043b.tar.gz
gcc-c88770e9dfa1b4c4175e39a3a62264c8bcb0043b.tar.bz2
c-decl.c (maybe_build_cleanup): Remove.
* c-decl.c (maybe_build_cleanup): Remove. * expr.c (expand_expr): Use langhook. * langhooks-def.h (lhd_return_null_tree, LANG_HOOKS_MAYBE_BUILD_CLEANUP): New. (LANGHOOKS_INITIALIZER): Update. * langhooks.c (lhd_return_null_tree): New. * langhooks.h (struct lang_hooks): New hook. * tree-inline.c (initialize_inlined_parameters): Use langhook. * tree.h (maybe_build_cleanup): Remove. ada: * misc.c (maybe_build_cleanup): Remove. cp: * cp-tree.h (cxx_maybe_build_cleanup): New. * decl.c (destroy_local_var, hack_incomplete_structures): Update. (maybe_build_cleanup): Rename cxx_maybe_build_cleanup. * tree.c (build_target_expr): Update. f: * com.c (maybe_build_cleanup): Remove. java: * decl.c (maybe_build_cleanup): Remove. From-SVN: r51324
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/misc.c12
-rw-r--r--gcc/c-decl.c11
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/cp-tree.h1
-rw-r--r--gcc/cp/decl.c6
-rw-r--r--gcc/cp/tree.c2
-rw-r--r--gcc/expr.c3
-rw-r--r--gcc/f/ChangeLog4
-rw-r--r--gcc/f/com.c11
-rw-r--r--gcc/java/ChangeLog4
-rw-r--r--gcc/java/decl.c11
-rw-r--r--gcc/langhooks-def.h3
-rw-r--r--gcc/langhooks.c9
-rw-r--r--gcc/langhooks.h4
-rw-r--r--gcc/tree-inline.c2
-rw-r--r--gcc/tree.h6
18 files changed, 55 insertions, 57 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c0bbf01..ee9a97f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,15 @@
+2002-03-25 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * c-decl.c (maybe_build_cleanup): Remove.
+ * expr.c (expand_expr): Use langhook.
+ * langhooks-def.h (lhd_return_null_tree,
+ LANG_HOOKS_MAYBE_BUILD_CLEANUP): New.
+ (LANGHOOKS_INITIALIZER): Update.
+ * langhooks.c (lhd_return_null_tree): New.
+ * langhooks.h (struct lang_hooks): New hook.
+ * tree-inline.c (initialize_inlined_parameters): Use langhook.
+ * tree.h (maybe_build_cleanup): Remove.
+
2002-03-25 Jakub Jelinek <jakub@redhat.com>
* regrename.c (build_def_use): Move recog_memoized
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 72d4775..ecba441 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,7 @@
+2002-03-25 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * misc.c (maybe_build_cleanup): Remove.
+
2002-03-24 Neil Booth <neil@daikokuya.demon.co.uk>
* gigi.h (yyparse): Remove.
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c
index 7073c89..b32ba1f 100644
--- a/gcc/ada/misc.c
+++ b/gcc/ada/misc.c
@@ -406,18 +406,6 @@ gnat_init_gcc_eh ()
#endif
}
-
-/* If DECL has a cleanup, build and return that cleanup here.
- This is a callback called by expand_expr. */
-
-tree
-maybe_build_cleanup (decl)
- tree decl ATTRIBUTE_UNUSED;
-{
- /* There are no cleanups in C. */
- return NULL_TREE;
-}
-
/* Hooks for print-tree.c: */
static void
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index a727b27..6008b93 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -3657,17 +3657,6 @@ finish_decl (decl, init, asmspec_tree)
get_pending_sizes ();
}
-/* If DECL has a cleanup, build and return that cleanup here.
- This is a callback called by expand_expr. */
-
-tree
-maybe_build_cleanup (decl)
- tree decl ATTRIBUTE_UNUSED;
-{
- /* There are no cleanups in C. */
- return NULL_TREE;
-}
-
/* Given a parsed parameter declaration,
decode it into a PARM_DECL and push that on the current binding level.
Also, for the sake of forward parm decls,
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index df1bd57..8c66270 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2002-03-25 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * cp-tree.h (cxx_maybe_build_cleanup): New.
+ * decl.c (destroy_local_var, hack_incomplete_structures): Update.
+ (maybe_build_cleanup): Rename cxx_maybe_build_cleanup.
+ * tree.c (build_target_expr): Update.
+
2002-03-24 Neil Booth <neil@daikokuya.demon.co.uk>
* decl2.c (cxx_decode_option): Handle -E.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index f213f7b..3a7ccc4 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4241,6 +4241,7 @@ extern void end_input PARAMS ((void));
/* in tree.c */
extern tree stabilize_expr PARAMS ((tree, tree *));
extern tree cxx_unsave_expr_now PARAMS ((tree));
+extern tree cxx_maybe_build_cleanup PARAMS ((tree));
extern void init_tree PARAMS ((void));
extern int pod_type_p PARAMS ((tree));
extern tree canonical_type_variant PARAMS ((tree));
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 9a3a053..c739c9e 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -8034,7 +8034,7 @@ destroy_local_var (decl)
return;
/* Compute the cleanup. */
- cleanup = maybe_build_cleanup (decl);
+ cleanup = cxx_maybe_build_cleanup (decl);
/* Record the cleanup required for this declaration. */
if (DECL_SIZE (decl) && cleanup)
@@ -14451,7 +14451,7 @@ hack_incomplete_structures (type)
{
tree cleanup;
expand_decl (decl);
- cleanup = maybe_build_cleanup (decl);
+ cleanup = cxx_maybe_build_cleanup (decl);
expand_decl_init (decl);
if (! expand_decl_cleanup (decl, cleanup))
error ("parser lost in parsing declaration of `%D'",
@@ -14479,7 +14479,7 @@ hack_incomplete_structures (type)
here. */
tree
-maybe_build_cleanup (decl)
+cxx_maybe_build_cleanup (decl)
tree decl;
{
tree type = TREE_TYPE (decl);
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 4f1b168..2cc78a7 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -234,7 +234,7 @@ build_target_expr (decl, value)
tree t;
t = build (TARGET_EXPR, TREE_TYPE (decl), decl, value,
- maybe_build_cleanup (decl), NULL_TREE);
+ cxx_maybe_build_cleanup (decl), NULL_TREE);
/* We always set TREE_SIDE_EFFECTS so that expand_expr does not
ignore the TARGET_EXPR. If there really turn out to be no
side-effects, then the optimizer should be able to get rid of
diff --git a/gcc/expr.c b/gcc/expr.c
index e6821d5..bc8b6a9 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8379,7 +8379,8 @@ expand_expr (exp, target, tmode, modifier)
built here. */
if (TREE_OPERAND (exp, 2) == 0)
- TREE_OPERAND (exp, 2) = maybe_build_cleanup (slot);
+ TREE_OPERAND (exp, 2)
+ = (*lang_hooks.maybe_build_cleanup) (slot);
cleanups = TREE_OPERAND (exp, 2);
}
}
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index 2f0f678..b200019 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,7 @@
+Mon Mar 25 19:27:11 2002 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * com.c (maybe_build_cleanup): Remove.
+
2002-03-23 Toon Moene <toon@moene.indiv.nluug.nl>
* com.c (ffecom_check_size_overflow_): Add a test
diff --git a/gcc/f/com.c b/gcc/f/com.c
index f698ae9..084519b 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -14381,17 +14381,6 @@ mark_addressable (exp)
}
}
-/* If DECL has a cleanup, build and return that cleanup here.
- This is a callback called by expand_expr. */
-
-tree
-maybe_build_cleanup (decl)
- tree decl UNUSED;
-{
- /* There are no cleanups in Fortran. */
- return NULL_TREE;
-}
-
/* Exit a binding level.
Pop the level off, and restore the state of the identifier-decl mappings
that were in effect when this level was entered.
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index d43075c..64e8479 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,7 @@
+2002-03-25 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * decl.c (maybe_build_cleanup): Remove.
+
2002-03-22 Tom Tromey <tromey@redhat.com>
Andrew Haley <aph@cambridge.redhat.com>
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index ffcccb2..a84269d 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -1565,17 +1565,6 @@ java_dup_lang_specific_decl (node)
DECL_LANG_SPECIFIC (node) = x;
}
-/* If DECL has a cleanup, build and return that cleanup here.
- This is a callback called by expand_expr. */
-
-tree
-maybe_build_cleanup (decl)
- tree decl ATTRIBUTE_UNUSED;
-{
- /* There are no cleanups in Java (I think). */
- return NULL_TREE;
-}
-
void
give_name_to_locals (jcf)
JCF *jcf;
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index f70963e..fa840a6 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -42,6 +42,7 @@ extern void lhd_do_nothing_t PARAMS ((tree));
extern int lhd_decode_option PARAMS ((int, char **));
extern HOST_WIDE_INT lhd_get_alias_set PARAMS ((tree));
extern tree lhd_return_tree PARAMS ((tree));
+extern tree lhd_return_null_tree PARAMS ((tree));
extern int lhd_safe_from_p PARAMS ((rtx, tree));
extern int lhd_staticp PARAMS ((tree));
extern void lhd_clear_binding_stack PARAMS ((void));
@@ -81,6 +82,7 @@ tree lhd_tree_inlining_convert_parm_for_inlining PARAMS ((tree, tree, tree));
#define LANG_HOOKS_STATICP lhd_staticp
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
#define LANG_HOOKS_UNSAVE_EXPR_NOW lhd_unsave_expr_now
+#define LANG_HOOKS_MAYBE_BUILD_CLEANUP lhd_return_null_tree
#define LANG_HOOKS_HONOR_READONLY false
#define LANG_HOOKS_PRINT_STATISTICS lhd_do_nothing
#define LANG_HOOKS_PRINT_XNODE lhd_print_tree_nothing
@@ -175,6 +177,7 @@ int lhd_tree_dump_type_quals PARAMS ((tree));
LANG_HOOKS_STATICP, \
LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
LANG_HOOKS_UNSAVE_EXPR_NOW, \
+ LANG_HOOKS_MAYBE_BUILD_CLEANUP, \
LANG_HOOKS_HONOR_READONLY, \
LANG_HOOKS_PRINT_STATISTICS, \
LANG_HOOKS_PRINT_XNODE, \
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 4c4d7d6..4bbcd5e 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -56,6 +56,15 @@ lhd_return_tree (t)
return t;
}
+/* Do nothing (return NULL_TREE). */
+
+tree
+lhd_return_null_tree (t)
+ tree t ATTRIBUTE_UNUSED;
+{
+ return NULL_TREE;
+}
+
/* Do nothing; the default hook to decode an option. */
int
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index d2a3e482..d13d518 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -180,6 +180,10 @@ struct lang_hooks
things are cleared out. */
tree (*unsave_expr_now) PARAMS ((tree));
+ /* Called by expand_expr to build and return the cleanup-expression
+ for the passed TARGET_EXPR. Return NULL if there is none. */
+ tree (*maybe_build_cleanup) PARAMS ((tree));
+
/* Nonzero if TYPE_READONLY and TREE_READONLY should always be honored. */
bool honor_readonly;
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 46ea052..b255ee0 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -562,7 +562,7 @@ initialize_inlined_parameters (id, args, fn)
}
/* See if we need to clean up the declaration. */
- cleanup = maybe_build_cleanup (var);
+ cleanup = (*lang_hooks.maybe_build_cleanup) (var);
if (cleanup)
{
tree cleanup_stmt;
diff --git a/gcc/tree.h b/gcc/tree.h
index 04e1276..3018f2a 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2641,12 +2641,6 @@ extern tree unsigned_type PARAMS ((tree));
extern tree signed_type PARAMS ((tree));
-/* This function must be defined in the language-specific files.
- expand_expr calls it to build the cleanup-expression for a TARGET_EXPR.
- This is defined in a language-specific file. */
-
-extern tree maybe_build_cleanup PARAMS ((tree));
-
/* Given an expression EXP that may be a COMPONENT_REF or an ARRAY_REF,
look for nested component-refs or array-refs at constant positions
and find the ultimate containing object, which is returned. */