aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-07-16 13:51:31 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-07-16 13:51:31 -0700
commit7740f00d546112f3ceaa0c68caab28c10dc1d562 (patch)
tree1fb4722f84cb260ae7dddc523251e0014eb13091 /gcc/cp
parent26e79d1018d0e6bd50b96f5f3fabb0376e392dff (diff)
downloadgcc-7740f00d546112f3ceaa0c68caab28c10dc1d562.zip
gcc-7740f00d546112f3ceaa0c68caab28c10dc1d562.tar.gz
gcc-7740f00d546112f3ceaa0c68caab28c10dc1d562.tar.bz2
langhooks-def.h (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING, [...]): Remove.
* langhooks-def.h (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING, lhd_tree_inlining_copy_res_decl_for_inlining): Remove. * langhooks.c (lhd_tree_inlining_copy_res_decl_for_inlining): Remove. * langhooks.h (struct lang_hooks_for_tree_inlining): Remove copy_res_decl_for_inlining. * tree-inline.c (declare_return_variable): New modify_dest argument. Use it as the return value, when possible or manditory. Handle TREE_ADDRESSABLE types. (expand_call_inline): Extract MODIFY_EXPR lhs for call. Simplify replacement of CALL_EXPR. cp/ * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die. * cp-tree.h (cp_copy_res_decl_for_inlining): Remove. * tree.c (cp_copy_res_decl_for_inlining): Remove. From-SVN: r84831
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/cp-lang.c3
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/decl.c4
-rw-r--r--gcc/cp/tree.c42
5 files changed, 8 insertions, 49 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index f34b38e..3945ebf 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-16 Richard Henderson <rth@redhat.com>
+
+ * cp-lang.c (LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING): Die.
+ * cp-tree.h (cp_copy_res_decl_for_inlining): Remove.
+ * tree.c (cp_copy_res_decl_for_inlining): Remove.
+
2004-07-16 Nathan Sidwell <nathan@codesourcery.com>
* class.c (finish_struct_bits): Use for loop.
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index b6e933f..27c9270 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -131,9 +131,6 @@ static void cxx_initialize_diagnostics (diagnostic_context *);
#undef LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P
#define LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P \
cp_auto_var_in_fn_p
-#undef LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING
-#define LANG_HOOKS_TREE_INLINING_COPY_RES_DECL_FOR_INLINING \
- cp_copy_res_decl_for_inlining
#undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P
#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P anon_aggr_type_p
#undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index d8e83d6..f61dc39 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -4206,8 +4206,6 @@ extern int cp_cannot_inline_tree_fn (tree*);
extern tree cp_add_pending_fn_decls (void*,tree);
extern int cp_is_overload_p (tree);
extern int cp_auto_var_in_fn_p (tree,tree);
-extern tree cp_copy_res_decl_for_inlining (tree, tree, tree, void*,
- int*, tree);
extern void cp_update_decl_after_saving (tree, void *);
/* in typeck.c */
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 7548721..6279eb5 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -10680,8 +10680,8 @@ cxx_push_function_context (struct function * f)
*cp_function_chain = *DECL_SAVED_FUNCTION_DATA (fn);
/* We don't need the saved data anymore. Unless this is an inline
- function; we need the named return value info for
- cp_copy_res_decl_for_inlining. */
+ function; we need the named return value info for
+ declare_return_variable. */
if (! DECL_INLINE (fn))
DECL_SAVED_FUNCTION_DATA (fn) = NULL;
}
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 4321b8a..253c1e6 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2093,48 +2093,6 @@ cp_auto_var_in_fn_p (tree var, tree fn)
&& nonstatic_local_decl_p (var));
}
-/* Tell whether a declaration is needed for the RESULT of a function
- FN being inlined into CALLER or if the top node of target_exprs is
- to be used. */
-
-tree
-cp_copy_res_decl_for_inlining (tree result,
- tree fn,
- tree caller,
- void* decl_map_ ATTRIBUTE_UNUSED,
- int* need_decl,
- tree return_slot_addr)
-{
- tree var;
-
- /* If FN returns an aggregate then the caller will always pass the
- address of the return slot explicitly. If we were just to
- create a new VAR_DECL here, then the result of this function
- would be copied (bitwise) into the variable initialized by the
- TARGET_EXPR. That's incorrect, so we must transform any
- references to the RESULT into references to the target. */
-
- /* We should have an explicit return slot iff the return type is
- TREE_ADDRESSABLE. See gimplify_aggr_init_expr. */
- if (TREE_ADDRESSABLE (TREE_TYPE (result))
- != (return_slot_addr != NULL_TREE))
- abort ();
-
- *need_decl = !return_slot_addr;
- if (return_slot_addr)
- {
- var = build_indirect_ref (return_slot_addr, "");
- if (! same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (var),
- TREE_TYPE (result)))
- abort ();
- }
- /* Otherwise, make an appropriate copy. */
- else
- var = copy_decl_for_inlining (result, fn, caller);
-
- return var;
-}
-
/* FN body has been duplicated. Update language specific fields. */
void