diff options
author | Marc Poulhiès <dkm@kataplop.net> | 2023-09-16 23:31:34 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 19:04:37 +0100 |
commit | 0a99bfe15af01e15c07bb5003b54d351f64a5cde (patch) | |
tree | 5ae729f6cc78507580d8a8d42adad33468c6d1fc /gcc/rust | |
parent | 0a2219668d26d9b2191b1e7ef9627b589efb3c86 (diff) | |
download | gcc-0a99bfe15af01e15c07bb5003b54d351f64a5cde.zip gcc-0a99bfe15af01e15c07bb5003b54d351f64a5cde.tar.gz gcc-0a99bfe15af01e15c07bb5003b54d351f64a5cde.tar.bz2 |
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 <dkm@kataplop.net>
Diffstat (limited to 'gcc/rust')
-rw-r--r-- | gcc/rust/backend/rust-compile-expr.cc | 6 | ||||
-rw-r--r-- | gcc/rust/backend/rust-compile-type.cc | 7 | ||||
-rw-r--r-- | gcc/rust/rust-backend.h | 8 | ||||
-rw-r--r-- | gcc/rust/rust-gcc.cc | 8 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-tyty-call.cc | 2 | ||||
-rw-r--r-- | 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 2c8ed02..b827f4c 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<const TyTy::FnType *> (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 0c47102..8368fce 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 5a1bbd8..7bdf67b 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<typed_identifier> ¶meters, - const std::vector<typed_identifier> &results, - tree result_struct, location_t location); +function_type_variadic (const typed_identifier &receiver, + const std::vector<typed_identifier> ¶meters, + const std::vector<typed_identifier> &results, + tree result_struct, location_t location); tree function_ptr_type (tree result, const std::vector<tree> &praameters, diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc index 73c966a..580bda7 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<typed_identifier> ¶meters, - const std::vector<typed_identifier> &results, - tree result_struct, location_t) +function_type_variadic (const typed_identifier &receiver, + const std::vector<typed_identifier> ¶meters, + const std::vector<typed_identifier> &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 9ba3fd8..667d54c 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 16a8097..3ba24de 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; } |