* [PATCH] Trivial typo fix in variadic
@ 2023-09-17 19:46 Marc Poulhiès
2023-09-18 7:40 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: Marc Poulhiès @ 2023-09-17 19:46 UTC (permalink / raw)
To: gcc-patches; +Cc: Marc Poulhiès
Fix all occurences of varadic, except for Rust (will be part of another change).
gcc/ChangeLog:
* config/nvptx/nvptx.h (struct machine_function): Fix typo in variadic.
* config/nvptx/nvptx.cc (nvptx_function_arg_advance): Adjust to use fixed name.
(nvptx_declare_function_name): Likewise.
(nvptx_call_args): Likewise.
(nvptx_expand_call): Likewise.
gcc/cp/ChangeLog:
* lambda.cc (compare_lambda_sig): Fix typo in variadic.
libcpp/ChangeLog:
* macro.cc (parse_params): Fix typo in variadic.
(create_iso_definition): Likewise.
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
---
Hi,
I came across this trivial typo and fixed it.
The compiler still builds correctly.
I've bootstraped x86_64-linux.
As I don't really know how to setup nvptx correctly (and not sure
this trivial fix warrants learning the full setup...), I've simply
built the compiler for nvptx-none.
Ok for master?
gcc/config/nvptx/nvptx.cc | 14 +++++++-------
gcc/config/nvptx/nvptx.h | 4 ++--
gcc/cp/lambda.cc | 2 +-
libcpp/macro.cc | 20 ++++++++++----------
4 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
index edef39fb5e1..0de42408841 100644
--- a/gcc/config/nvptx/nvptx.cc
+++ b/gcc/config/nvptx/nvptx.cc
@@ -720,7 +720,7 @@ nvptx_function_arg_advance (cumulative_args_t cum_v, const function_arg_info &)
/* Implement TARGET_FUNCTION_ARG_BOUNDARY.
- For nvptx This is only used for varadic args. The type has already
+ For nvptx This is only used for variadic args. The type has already
been promoted and/or converted to invisible reference. */
static unsigned
@@ -1548,7 +1548,7 @@ nvptx_declare_function_name (FILE *file, const char *name, const_tree decl)
if (!TARGET_SOFT_STACK)
{
/* Declare a local var for outgoing varargs. */
- if (cfun->machine->has_varadic)
+ if (cfun->machine->has_variadic)
init_frame (file, STACK_POINTER_REGNUM,
UNITS_PER_WORD, crtl->outgoing_args_size);
@@ -1558,7 +1558,7 @@ nvptx_declare_function_name (FILE *file, const char *name, const_tree decl)
init_frame (file, FRAME_POINTER_REGNUM, alignment,
ROUND_UP (sz, GET_MODE_SIZE (DImode)));
}
- else if (need_frameptr || cfun->machine->has_varadic || cfun->calls_alloca
+ else if (need_frameptr || cfun->machine->has_variadic || cfun->calls_alloca
|| (cfun->machine->has_simtreg && !crtl->is_leaf))
init_softstack_frame (file, alignment, sz);
@@ -1795,13 +1795,13 @@ nvptx_call_args (rtx arg, tree fntype)
if (!cfun->machine->doing_call)
{
cfun->machine->doing_call = true;
- cfun->machine->is_varadic = false;
+ cfun->machine->is_variadic = false;
cfun->machine->num_args = 0;
if (fntype && stdarg_p (fntype))
{
- cfun->machine->is_varadic = true;
- cfun->machine->has_varadic = true;
+ cfun->machine->is_variadic = true;
+ cfun->machine->has_variadic = true;
cfun->machine->num_args++;
}
}
@@ -1871,7 +1871,7 @@ nvptx_expand_call (rtx retval, rtx address)
}
unsigned nargs = cfun->machine->num_args;
- if (cfun->machine->is_varadic)
+ if (cfun->machine->is_variadic)
{
varargs = gen_reg_rtx (Pmode);
emit_move_insn (varargs, stack_pointer_rtx);
diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index 129427e5654..666021283c2 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -209,8 +209,8 @@ struct GTY(()) machine_function
{
rtx_expr_list *call_args; /* Arg list for the current call. */
bool doing_call; /* Within a CALL_ARGS ... CALL_ARGS_END sequence. */
- bool is_varadic; /* This call is varadic */
- bool has_varadic; /* Current function has a varadic call. */
+ bool is_variadic; /* This call is variadic */
+ bool has_variadic; /* Current function has a variadic call. */
bool has_chain; /* Current function has outgoing static chain. */
bool has_softstack; /* Current function has a soft stack frame. */
bool has_simtreg; /* Current function has an OpenMP SIMD region. */
diff --git a/gcc/cp/lambda.cc b/gcc/cp/lambda.cc
index a359bc6ee8d..34d0190a89b 100644
--- a/gcc/cp/lambda.cc
+++ b/gcc/cp/lambda.cc
@@ -1619,7 +1619,7 @@ compare_lambda_sig (tree fn_a, tree fn_b)
{
if (!args_a || !args_b)
return false;
- // This check also deals with differing varadicness
+ // This check also deals with differing variadicness
if (!same_type_p (TREE_VALUE (args_a), TREE_VALUE (args_b)))
return false;
}
diff --git a/libcpp/macro.cc b/libcpp/macro.cc
index dada8fea835..4f229c1501c 100644
--- a/libcpp/macro.cc
+++ b/libcpp/macro.cc
@@ -3431,7 +3431,7 @@ _cpp_unsave_parameters (cpp_reader *pfile, unsigned n)
*/
static bool
-parse_params (cpp_reader *pfile, unsigned *n_ptr, bool *varadic_ptr)
+parse_params (cpp_reader *pfile, unsigned *n_ptr, bool *variadic_ptr)
{
unsigned nparms = 0;
bool ok = false;
@@ -3462,7 +3462,7 @@ parse_params (cpp_reader *pfile, unsigned *n_ptr, bool *varadic_ptr)
};
unsigned ix = prev_ident;
const unsigned char *as_text = NULL;
- if (*varadic_ptr)
+ if (*variadic_ptr)
ix = 4;
else if (token->type == CPP_EOF)
ix += 2;
@@ -3473,7 +3473,7 @@ parse_params (cpp_reader *pfile, unsigned *n_ptr, bool *varadic_ptr)
goto out;
case CPP_NAME:
- if (prev_ident || *varadic_ptr)
+ if (prev_ident || *variadic_ptr)
goto bad;
prev_ident = true;
@@ -3484,7 +3484,7 @@ parse_params (cpp_reader *pfile, unsigned *n_ptr, bool *varadic_ptr)
break;
case CPP_CLOSE_PAREN:
- if (prev_ident || !nparms || *varadic_ptr)
+ if (prev_ident || !nparms || *variadic_ptr)
{
ok = true;
goto out;
@@ -3492,15 +3492,15 @@ parse_params (cpp_reader *pfile, unsigned *n_ptr, bool *varadic_ptr)
/* FALLTHRU */
case CPP_COMMA:
- if (!prev_ident || *varadic_ptr)
+ if (!prev_ident || *variadic_ptr)
goto bad;
prev_ident = false;
break;
case CPP_ELLIPSIS:
- if (*varadic_ptr)
+ if (*variadic_ptr)
goto bad;
- *varadic_ptr = true;
+ *variadic_ptr = true;
if (!prev_ident)
{
/* An ISO bare ellipsis. */
@@ -3577,7 +3577,7 @@ create_iso_definition (cpp_reader *pfile)
unsigned int num_extra_tokens = 0;
unsigned nparms = 0;
cpp_hashnode **params = NULL;
- bool varadic = false;
+ bool variadic = false;
bool ok = false;
cpp_macro *macro = NULL;
@@ -3594,7 +3594,7 @@ create_iso_definition (cpp_reader *pfile)
else if (token->type == CPP_OPEN_PAREN)
{
/* An open-paren, get a parameter list. */
- if (!parse_params (pfile, &nparms, &varadic))
+ if (!parse_params (pfile, &nparms, &variadic))
goto out;
params = (cpp_hashnode **)_cpp_commit_buff
@@ -3645,7 +3645,7 @@ create_iso_definition (cpp_reader *pfile)
if (!token)
{
- macro->variadic = varadic;
+ macro->variadic = variadic;
macro->paramc = nparms;
macro->parm.params = params;
macro->fun_like = true;
--
2.40.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Trivial typo fix in variadic
2023-09-17 19:46 [PATCH] Trivial typo fix in variadic Marc Poulhiès
@ 2023-09-18 7:40 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2023-09-18 7:40 UTC (permalink / raw)
To: Marc Poulhiès; +Cc: gcc-patches
On Sun, Sep 17, 2023 at 9:47 PM Marc Poulhiès via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Fix all occurences of varadic, except for Rust (will be part of another change).
OK.
> gcc/ChangeLog:
>
> * config/nvptx/nvptx.h (struct machine_function): Fix typo in variadic.
> * config/nvptx/nvptx.cc (nvptx_function_arg_advance): Adjust to use fixed name.
> (nvptx_declare_function_name): Likewise.
> (nvptx_call_args): Likewise.
> (nvptx_expand_call): Likewise.
>
> gcc/cp/ChangeLog:
>
> * lambda.cc (compare_lambda_sig): Fix typo in variadic.
>
> libcpp/ChangeLog:
>
> * macro.cc (parse_params): Fix typo in variadic.
> (create_iso_definition): Likewise.
>
> Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
> ---
>
> Hi,
>
> I came across this trivial typo and fixed it.
>
> The compiler still builds correctly.
> I've bootstraped x86_64-linux.
> As I don't really know how to setup nvptx correctly (and not sure
> this trivial fix warrants learning the full setup...), I've simply
> built the compiler for nvptx-none.
>
> Ok for master?
>
> gcc/config/nvptx/nvptx.cc | 14 +++++++-------
> gcc/config/nvptx/nvptx.h | 4 ++--
> gcc/cp/lambda.cc | 2 +-
> libcpp/macro.cc | 20 ++++++++++----------
> 4 files changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
> index edef39fb5e1..0de42408841 100644
> --- a/gcc/config/nvptx/nvptx.cc
> +++ b/gcc/config/nvptx/nvptx.cc
> @@ -720,7 +720,7 @@ nvptx_function_arg_advance (cumulative_args_t cum_v, const function_arg_info &)
>
> /* Implement TARGET_FUNCTION_ARG_BOUNDARY.
>
> - For nvptx This is only used for varadic args. The type has already
> + For nvptx This is only used for variadic args. The type has already
> been promoted and/or converted to invisible reference. */
>
> static unsigned
> @@ -1548,7 +1548,7 @@ nvptx_declare_function_name (FILE *file, const char *name, const_tree decl)
> if (!TARGET_SOFT_STACK)
> {
> /* Declare a local var for outgoing varargs. */
> - if (cfun->machine->has_varadic)
> + if (cfun->machine->has_variadic)
> init_frame (file, STACK_POINTER_REGNUM,
> UNITS_PER_WORD, crtl->outgoing_args_size);
>
> @@ -1558,7 +1558,7 @@ nvptx_declare_function_name (FILE *file, const char *name, const_tree decl)
> init_frame (file, FRAME_POINTER_REGNUM, alignment,
> ROUND_UP (sz, GET_MODE_SIZE (DImode)));
> }
> - else if (need_frameptr || cfun->machine->has_varadic || cfun->calls_alloca
> + else if (need_frameptr || cfun->machine->has_variadic || cfun->calls_alloca
> || (cfun->machine->has_simtreg && !crtl->is_leaf))
> init_softstack_frame (file, alignment, sz);
>
> @@ -1795,13 +1795,13 @@ nvptx_call_args (rtx arg, tree fntype)
> if (!cfun->machine->doing_call)
> {
> cfun->machine->doing_call = true;
> - cfun->machine->is_varadic = false;
> + cfun->machine->is_variadic = false;
> cfun->machine->num_args = 0;
>
> if (fntype && stdarg_p (fntype))
> {
> - cfun->machine->is_varadic = true;
> - cfun->machine->has_varadic = true;
> + cfun->machine->is_variadic = true;
> + cfun->machine->has_variadic = true;
> cfun->machine->num_args++;
> }
> }
> @@ -1871,7 +1871,7 @@ nvptx_expand_call (rtx retval, rtx address)
> }
>
> unsigned nargs = cfun->machine->num_args;
> - if (cfun->machine->is_varadic)
> + if (cfun->machine->is_variadic)
> {
> varargs = gen_reg_rtx (Pmode);
> emit_move_insn (varargs, stack_pointer_rtx);
> diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
> index 129427e5654..666021283c2 100644
> --- a/gcc/config/nvptx/nvptx.h
> +++ b/gcc/config/nvptx/nvptx.h
> @@ -209,8 +209,8 @@ struct GTY(()) machine_function
> {
> rtx_expr_list *call_args; /* Arg list for the current call. */
> bool doing_call; /* Within a CALL_ARGS ... CALL_ARGS_END sequence. */
> - bool is_varadic; /* This call is varadic */
> - bool has_varadic; /* Current function has a varadic call. */
> + bool is_variadic; /* This call is variadic */
> + bool has_variadic; /* Current function has a variadic call. */
> bool has_chain; /* Current function has outgoing static chain. */
> bool has_softstack; /* Current function has a soft stack frame. */
> bool has_simtreg; /* Current function has an OpenMP SIMD region. */
> diff --git a/gcc/cp/lambda.cc b/gcc/cp/lambda.cc
> index a359bc6ee8d..34d0190a89b 100644
> --- a/gcc/cp/lambda.cc
> +++ b/gcc/cp/lambda.cc
> @@ -1619,7 +1619,7 @@ compare_lambda_sig (tree fn_a, tree fn_b)
> {
> if (!args_a || !args_b)
> return false;
> - // This check also deals with differing varadicness
> + // This check also deals with differing variadicness
> if (!same_type_p (TREE_VALUE (args_a), TREE_VALUE (args_b)))
> return false;
> }
> diff --git a/libcpp/macro.cc b/libcpp/macro.cc
> index dada8fea835..4f229c1501c 100644
> --- a/libcpp/macro.cc
> +++ b/libcpp/macro.cc
> @@ -3431,7 +3431,7 @@ _cpp_unsave_parameters (cpp_reader *pfile, unsigned n)
> */
>
> static bool
> -parse_params (cpp_reader *pfile, unsigned *n_ptr, bool *varadic_ptr)
> +parse_params (cpp_reader *pfile, unsigned *n_ptr, bool *variadic_ptr)
> {
> unsigned nparms = 0;
> bool ok = false;
> @@ -3462,7 +3462,7 @@ parse_params (cpp_reader *pfile, unsigned *n_ptr, bool *varadic_ptr)
> };
> unsigned ix = prev_ident;
> const unsigned char *as_text = NULL;
> - if (*varadic_ptr)
> + if (*variadic_ptr)
> ix = 4;
> else if (token->type == CPP_EOF)
> ix += 2;
> @@ -3473,7 +3473,7 @@ parse_params (cpp_reader *pfile, unsigned *n_ptr, bool *varadic_ptr)
> goto out;
>
> case CPP_NAME:
> - if (prev_ident || *varadic_ptr)
> + if (prev_ident || *variadic_ptr)
> goto bad;
> prev_ident = true;
>
> @@ -3484,7 +3484,7 @@ parse_params (cpp_reader *pfile, unsigned *n_ptr, bool *varadic_ptr)
> break;
>
> case CPP_CLOSE_PAREN:
> - if (prev_ident || !nparms || *varadic_ptr)
> + if (prev_ident || !nparms || *variadic_ptr)
> {
> ok = true;
> goto out;
> @@ -3492,15 +3492,15 @@ parse_params (cpp_reader *pfile, unsigned *n_ptr, bool *varadic_ptr)
>
> /* FALLTHRU */
> case CPP_COMMA:
> - if (!prev_ident || *varadic_ptr)
> + if (!prev_ident || *variadic_ptr)
> goto bad;
> prev_ident = false;
> break;
>
> case CPP_ELLIPSIS:
> - if (*varadic_ptr)
> + if (*variadic_ptr)
> goto bad;
> - *varadic_ptr = true;
> + *variadic_ptr = true;
> if (!prev_ident)
> {
> /* An ISO bare ellipsis. */
> @@ -3577,7 +3577,7 @@ create_iso_definition (cpp_reader *pfile)
> unsigned int num_extra_tokens = 0;
> unsigned nparms = 0;
> cpp_hashnode **params = NULL;
> - bool varadic = false;
> + bool variadic = false;
> bool ok = false;
> cpp_macro *macro = NULL;
>
> @@ -3594,7 +3594,7 @@ create_iso_definition (cpp_reader *pfile)
> else if (token->type == CPP_OPEN_PAREN)
> {
> /* An open-paren, get a parameter list. */
> - if (!parse_params (pfile, &nparms, &varadic))
> + if (!parse_params (pfile, &nparms, &variadic))
> goto out;
>
> params = (cpp_hashnode **)_cpp_commit_buff
> @@ -3645,7 +3645,7 @@ create_iso_definition (cpp_reader *pfile)
>
> if (!token)
> {
> - macro->variadic = varadic;
> + macro->variadic = variadic;
> macro->paramc = nparms;
> macro->parm.params = params;
> macro->fun_like = true;
> --
> 2.40.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-18 7:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-17 19:46 [PATCH] Trivial typo fix in variadic Marc Poulhiès
2023-09-18 7:40 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).