From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7905) id 46C0F3857BAC; Tue, 16 Jan 2024 18:13:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 46C0F3857BAC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705428836; bh=ROOl6COKfUdtlR8ovw4pSC1PJKuDh8zbn2amwk+yu/c=; h=From:To:Subject:Date:From; b=CckCrMcAB9rUHelcuUcUPOluNm0g20ja9NzQgYcBN2/POnyzhW8LWnz739f61WiSQ RYvC50VZ3SEiO04JsSLASMusXwpjVbPDpRcD1k1H1ZJ2oGCYxy+IzVT3GoKb4ZaRWk xpHG7Rw/3vrrNVT/NtmFU1jxPkXE1GN3YldC9in4= MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Arthur Cohen To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-8018] gccrs: Minor typo fix X-Act-Checkin: gcc X-Git-Author: =?utf-8?q?Marc_Poulhi=C3=A8s?= X-Git-Refname: refs/heads/trunk X-Git-Oldrev: 0a2219668d26d9b2191b1e7ef9627b589efb3c86 X-Git-Newrev: 0a99bfe15af01e15c07bb5003b54d351f64a5cde Message-Id: <20240116181356.46C0F3857BAC@sourceware.org> Date: Tue, 16 Jan 2024 18:13:56 +0000 (GMT) List-Id: https://gcc.gnu.org/g:0a99bfe15af01e15c07bb5003b54d351f64a5cde commit r14-8018-g0a99bfe15af01e15c07bb5003b54d351f64a5cde Author: Marc Poulhiès Date: Sat Sep 16 23:31:34 2023 +0200 gccrs: Minor typo fix 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 Diff: --- 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 2c8ed0282a8..b827f4cf82e 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 0c4710228d4..8368fce69bc 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 5a1bbd874e9..7bdf67b46ef 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 73c966a3320..580bda7f00a 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 9ba3fd83f0e..667d54c6d9e 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 16a80976e4f..3ba24de10d9 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; }