diff options
author | Jason Merrill <jason@redhat.com> | 2002-12-04 15:13:01 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2002-12-04 15:13:01 -0500 |
commit | c246c65d7638d21cf773a4fab446870c93635390 (patch) | |
tree | b67e00c5506ddc2ca24b4895249a6aa8ba5a0347 /gcc/tree-inline.c | |
parent | ae598ab989bc96176b5218df66234a006acdf52e (diff) | |
download | gcc-c246c65d7638d21cf773a4fab446870c93635390.zip gcc-c246c65d7638d21cf773a4fab446870c93635390.tar.gz gcc-c246c65d7638d21cf773a4fab446870c93635390.tar.bz2 |
PR c++/8461, c++/8625
PR c++/8461, c++/8625
* integrate.c (copy_decl_for_inlining): Handle explicit invisible
references.
* tree-inline.c (initialize_inlined_parameters): Likewise.
2002-12-03 Jason Merrill <jason@redhat.com>
PR c++/8461, c++/8625
* call.c (convert_for_arg_passing): Don't mess with error_mark_node.
(cp_convert_parm_for_inlining): Remove.
* cp-lang.c (LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING):
Remove.
* cp-tree.h (ADDR_IS_INVISIREF): Remove.
* except.c (stabilize_throw_expr): Remove ADDR_IS_INVISIREF code.
From-SVN: r59827
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 6dea353..0f5ab59 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -632,6 +632,7 @@ initialize_inlined_parameters (id, args, fn, block) #endif /* not INLINER_FOR_JAVA */ tree var; tree value; + tree var_sub; /* Find the initializer. */ value = (*lang_hooks.tree_inlining.convert_parm_for_inlining) @@ -669,12 +670,23 @@ initialize_inlined_parameters (id, args, fn, block) /* Make an equivalent VAR_DECL. */ var = copy_decl_for_inlining (p, fn, VARRAY_TREE (id->fns, 0)); + + /* See if the frontend wants to pass this by invisible reference. If + so, our new VAR_DECL will have REFERENCE_TYPE, and we need to + replace uses of the PARM_DECL with dereferences. */ + if (TREE_TYPE (var) != TREE_TYPE (p) + && POINTER_TYPE_P (TREE_TYPE (var)) + && TREE_TYPE (TREE_TYPE (var)) == TREE_TYPE (p)) + var_sub = build1 (INDIRECT_REF, TREE_TYPE (p), var); + else + var_sub = var; + /* Register the VAR_DECL as the equivalent for the PARM_DECL; that way, when the PARM_DECL is encountered, it will be automatically replaced by the VAR_DECL. */ splay_tree_insert (id->decl_map, (splay_tree_key) p, - (splay_tree_value) var); + (splay_tree_value) var_sub); /* Declare this new variable. */ #ifndef INLINER_FOR_JAVA |