summaryrefslogtreecommitdiff
path: root/gcc/calls.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-08-20 08:54:03 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-08-20 08:54:03 +0000
commit257caa552bf930e2770100de70a459a4ede837c0 (patch)
treef451a876ef90a91912575133c1f26b0708b25830 /gcc/calls.h
parentcf0d189eb989906d17010ca7c0b07f1763d5fde5 (diff)
Add a pass_by_reference flag to function_arg_info
This patch adds a flag that tells targets whether an argument has been converted to pass-by-reference form. This replaces assign_parm_data_one::passed_pointer in function.c. The flag is set automatically for places that call apply_pass_by_reference_rules. Places that apply pass-by-reference manually need to set it themselves. (After previous changes, no targets apply pass-by-reference manually. They all go through apply_pass_by_reference_rules.) 2019-08-20 Richard Sandiford <richard.sandiford@arm.com> gcc/ * calls.h (function_arg_info): Add a pass_by_reference field, defaulting to false. * calls.c (apply_pass_by_reference_rules): Set pass_by_reference when applying pass-by-reference semantics. (initialize_argument_information): Likewise. (emit_library_call_value_1): Likewise. * function.c (assign_parm_data_one): Remove passed_pointer field. (assign_parm_find_data_types): Don't set it. (assign_parm_find_stack_rtl, assign_parm_adjust_stack_rtl) (assign_parm_setup_reg, assign_parms, gimplify_parameters): Use arg.pass_by_reference instead of passed_pointer. From-SVN: r274707
Diffstat (limited to 'gcc/calls.h')
-rw-r--r--gcc/calls.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/calls.h b/gcc/calls.h
index 01ab3905a3a..a782a7d3695 100644
--- a/gcc/calls.h
+++ b/gcc/calls.h
@@ -34,21 +34,25 @@ along with GCC; see the file COPYING3. If not see
class function_arg_info
{
public:
- function_arg_info () : type (NULL_TREE), mode (VOIDmode), named (false) {}
+ function_arg_info ()
+ : type (NULL_TREE), mode (VOIDmode), named (false),
+ pass_by_reference (false)
+ {}
/* Initialize an argument of mode MODE, either before or after promotion. */
function_arg_info (machine_mode mode, bool named)
- : type (NULL_TREE), mode (mode), named (named)
+ : type (NULL_TREE), mode (mode), named (named), pass_by_reference (false)
{}
/* Initialize an unpromoted argument of type TYPE. */
function_arg_info (tree type, bool named)
- : type (type), mode (TYPE_MODE (type)), named (named)
+ : type (type), mode (TYPE_MODE (type)), named (named),
+ pass_by_reference (false)
{}
/* Initialize an argument with explicit properties. */
function_arg_info (tree type, machine_mode mode, bool named)
- : type (type), mode (mode), named (named)
+ : type (type), mode (mode), named (named), pass_by_reference (false)
{}
/* Return true if the gimple-level type is an aggregate. */
@@ -100,6 +104,10 @@ public:
treated as an unnamed variadic argument (i.e. one passed through
"..."). See also TARGET_STRICT_ARGUMENT_NAMING. */
unsigned int named : 1;
+
+ /* True if we have decided to pass the argument by reference, in which case
+ the function_arg_info describes a pointer to the original argument. */
+ unsigned int pass_by_reference : 1;
};
extern int flags_from_decl_or_type (const_tree);