]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Minor typo fix
authorMarc Poulhiès <dkm@kataplop.net>
Sat, 16 Sep 2023 21:31:34 +0000 (23:31 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:04:37 +0000 (19:04 +0100)
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>
gcc/rust/backend/rust-compile-expr.cc
gcc/rust/backend/rust-compile-type.cc
gcc/rust/rust-backend.h
gcc/rust/rust-gcc.cc
gcc/rust/typecheck/rust-tyty-call.cc
gcc/rust/typecheck/rust-tyty.h

index 2c8ed0282a8727dd8e12ab5a992e589188d0c0b6..b827f4cf82eadcb2502050d9dea527016e8bd96b 100644 (file)
@@ -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;
index 0c4710228d49dbe0543dbd33c227a56e3571b2c9..8368fce69bc57cdc912e95d1b988f76e01285f21 100644 (file)
@@ -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
index 5a1bbd874e9592a6e9e850c2dedd818e932e07d5..7bdf67b46ef9e8d0484c2af8c5149401453d9a9a 100644 (file)
@@ -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> &parameters,
-                      const std::vector<typed_identifier> &results,
-                      tree result_struct, location_t location);
+function_type_variadic (const typed_identifier &receiver,
+                       const std::vector<typed_identifier> &parameters,
+                       const std::vector<typed_identifier> &results,
+                       tree result_struct, location_t location);
 
 tree
 function_ptr_type (tree result, const std::vector<tree> &praameters,
index 73c966a3320cb431520fd769861663244f5d22b7..580bda7f00a45654f22f31c7f0d15784304292d0 100644 (file)
@@ -513,10 +513,10 @@ function_type (const typed_identifier &receiver,
 }
 
 tree
-function_type_varadic (const typed_identifier &receiver,
-                      const std::vector<typed_identifier> &parameters,
-                      const std::vector<typed_identifier> &results,
-                      tree result_struct, location_t)
+function_type_variadic (const typed_identifier &receiver,
+                       const std::vector<typed_identifier> &parameters,
+                       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);
index 9ba3fd83f0eaee9fe88738da16d1b2db4e89cce7..667d54c6d9eaac754b87a102051d1a302b14713c 100644 (file)
@@ -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 ())
            {
index 16a80976e4f2535791843179a39e02cf5364e759..3ba24de10d9c380364d898bd32ab05d11ef519e0 100644 (file)
@@ -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; }