aboutsummaryrefslogtreecommitdiff
path: root/gcc/integrate.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2002-12-04 15:13:01 -0500
committerJason Merrill <jason@gcc.gnu.org>2002-12-04 15:13:01 -0500
commitc246c65d7638d21cf773a4fab446870c93635390 (patch)
treeb67e00c5506ddc2ca24b4895249a6aa8ba5a0347 /gcc/integrate.c
parentae598ab989bc96176b5218df66234a006acdf52e (diff)
downloadgcc-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/integrate.c')
-rw-r--r--gcc/integrate.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c
index 0e54e48..7752d66 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -344,12 +344,36 @@ copy_decl_for_inlining (decl, from_fn, to_fn)
/* Copy the declaration. */
if (TREE_CODE (decl) == PARM_DECL || TREE_CODE (decl) == RESULT_DECL)
{
+ tree type;
+ int invisiref = 0;
+
+ /* See if the frontend wants to pass this by invisible reference. */
+ if (TREE_CODE (decl) == PARM_DECL
+ && DECL_ARG_TYPE (decl) != TREE_TYPE (decl)
+ && POINTER_TYPE_P (DECL_ARG_TYPE (decl))
+ && TREE_TYPE (DECL_ARG_TYPE (decl)) == TREE_TYPE (decl))
+ {
+ invisiref = 1;
+ type = DECL_ARG_TYPE (decl);
+ }
+ else
+ type = TREE_TYPE (decl);
+
/* For a parameter, we must make an equivalent VAR_DECL, not a
new PARM_DECL. */
- copy = build_decl (VAR_DECL, DECL_NAME (decl), TREE_TYPE (decl));
- TREE_ADDRESSABLE (copy) = TREE_ADDRESSABLE (decl);
- TREE_READONLY (copy) = TREE_READONLY (decl);
- TREE_THIS_VOLATILE (copy) = TREE_THIS_VOLATILE (decl);
+ copy = build_decl (VAR_DECL, DECL_NAME (decl), type);
+ if (!invisiref)
+ {
+ TREE_ADDRESSABLE (copy) = TREE_ADDRESSABLE (decl);
+ TREE_READONLY (copy) = TREE_READONLY (decl);
+ TREE_THIS_VOLATILE (copy) = TREE_THIS_VOLATILE (decl);
+ }
+ else
+ {
+ TREE_ADDRESSABLE (copy) = 0;
+ TREE_READONLY (copy) = 1;
+ TREE_THIS_VOLATILE (copy) = 0;
+ }
}
else
{