diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-12-04 20:13:01 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-12-04 20:13:01 +0000 |
commit | a6543b83eaed8c28c6b9068d31a98a77abdfd355 (patch) | |
tree | b67e00c5506ddc2ca24b4895249a6aa8ba5a0347 /gcc/integrate.c | |
parent | b25817c60ef9b5e2694ba32849e29aaf7b4aaea6 (diff) | |
download | gcc-a6543b83eaed8c28c6b9068d31a98a77abdfd355.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59827 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/integrate.c')
-rw-r--r-- | gcc/integrate.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c index 0e54e48b1cf..7752d66fb51 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 { |