From 0a99bfe15af01e15c07bb5003b54d351f64a5cde Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20Poulhi=C3=A8s?= Date: Sat, 16 Sep 2023 23:31:34 +0200 Subject: [PATCH] gccrs: Minor typo fix MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix varadic -> variadic gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): Fix typo in varIadic. * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Likewise. * rust-backend.h (function_type_varadic): Rename into ... (function_type_variadic): ... this. * rust-gcc.cc (function_type_varadic): Rename into ... (function_type_variadic): ... this. * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Likewise. * typecheck/rust-tyty.h (is_varadic): Renamed into ... (is_variadic): ... this. Signed-off-by: Marc Poulhiès --- gcc/rust/backend/rust-compile-expr.cc | 6 +++--- gcc/rust/backend/rust-compile-type.cc | 7 ++++--- gcc/rust/rust-backend.h | 8 ++++---- gcc/rust/rust-gcc.cc | 8 ++++---- gcc/rust/typecheck/rust-tyty-call.cc | 2 +- gcc/rust/typecheck/rust-tyty.h | 2 +- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc index 2c8ed0282a87..b827f4cf82ea 100644 --- a/gcc/rust/backend/rust-compile-expr.cc +++ b/gcc/rust/backend/rust-compile-expr.cc @@ -1634,11 +1634,11 @@ CompileExpr::visit (HIR::CallExpr &expr) if (possible_trait_call) return; - bool is_varadic = false; + bool is_variadic = false; if (tyty->get_kind () == TyTy::TypeKind::FNDEF) { const TyTy::FnType *fn = static_cast (tyty); - is_varadic = fn->is_varadic (); + is_variadic = fn->is_variadic (); } size_t required_num_args = expr.get_arguments ().size (); @@ -1659,7 +1659,7 @@ CompileExpr::visit (HIR::CallExpr &expr) auto &argument = expr.get_arguments ().at (i); auto rvalue = CompileExpr::Compile (argument.get (), ctx); - if (is_varadic && i >= required_num_args) + if (is_variadic && i >= required_num_args) { args.push_back (rvalue); continue; diff --git a/gcc/rust/backend/rust-compile-type.cc b/gcc/rust/backend/rust-compile-type.cc index 0c4710228d49..8368fce69bc5 100644 --- a/gcc/rust/backend/rust-compile-type.cc +++ b/gcc/rust/backend/rust-compile-type.cc @@ -218,12 +218,13 @@ TyTyResolveCompile::visit (const TyTy::FnType &type) parameters.push_back (compiled_param); } - if (!type.is_varadic ()) + if (!type.is_variadic ()) translated = Backend::function_type (receiver, parameters, results, NULL, type.get_ident ().locus); else - translated = Backend::function_type_varadic (receiver, parameters, results, - NULL, type.get_ident ().locus); + translated + = Backend::function_type_variadic (receiver, parameters, results, NULL, + type.get_ident ().locus); } void diff --git a/gcc/rust/rust-backend.h b/gcc/rust/rust-backend.h index 5a1bbd874e95..7bdf67b46ef9 100644 --- a/gcc/rust/rust-backend.h +++ b/gcc/rust/rust-backend.h @@ -122,10 +122,10 @@ function_type (const typed_identifier &receiver, location_t location); tree -function_type_varadic (const typed_identifier &receiver, - const std::vector ¶meters, - const std::vector &results, - tree result_struct, location_t location); +function_type_variadic (const typed_identifier &receiver, + const std::vector ¶meters, + const std::vector &results, + tree result_struct, location_t location); tree function_ptr_type (tree result, const std::vector &praameters, diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc index 73c966a3320c..580bda7f00a4 100644 --- a/gcc/rust/rust-gcc.cc +++ b/gcc/rust/rust-gcc.cc @@ -513,10 +513,10 @@ function_type (const typed_identifier &receiver, } tree -function_type_varadic (const typed_identifier &receiver, - const std::vector ¶meters, - const std::vector &results, - tree result_struct, location_t) +function_type_variadic (const typed_identifier &receiver, + const std::vector ¶meters, + const std::vector &results, + tree result_struct, location_t) { size_t n = parameters.size () + (receiver.type != NULL_TREE ? 1 : 0); tree *args = XALLOCAVEC (tree, n); diff --git a/gcc/rust/typecheck/rust-tyty-call.cc b/gcc/rust/typecheck/rust-tyty-call.cc index 9ba3fd83f0ea..667d54c6d9ea 100644 --- a/gcc/rust/typecheck/rust-tyty-call.cc +++ b/gcc/rust/typecheck/rust-tyty-call.cc @@ -116,7 +116,7 @@ TypeCheckCallExpr::visit (FnType &type) { if (call.num_params () != type.num_params ()) { - if (type.is_varadic ()) + if (type.is_variadic ()) { if (call.num_params () < type.num_params ()) { diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h index 16a80976e4f2..3ba24de10d9c 100644 --- a/gcc/rust/typecheck/rust-tyty.h +++ b/gcc/rust/typecheck/rust-tyty.h @@ -723,7 +723,7 @@ public: bool is_extern () const { return (flags & FNTYPE_IS_EXTERN_FLAG) != 0; } - bool is_varadic () const { return (flags & FNTYPE_IS_VARADIC_FLAG) != 0; } + bool is_variadic () const { return (flags & FNTYPE_IS_VARADIC_FLAG) != 0; } DefId get_id () const { return id; } -- 2.47.2