aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.cc
diff options
context:
space:
mode:
authorMarc Poulhiès <dkm@kataplop.net>2023-10-14 00:02:47 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 19:04:38 +0100
commit08b785601b847280652a0d05c3a06fa9c8d614dc (patch)
treeafabffbb00d910dfea845c0b4a46a77e18af8c8d /gcc/rust/backend/rust-compile-expr.cc
parentc20d7924f1515c99def98935bdf31d269eab6856 (diff)
downloadgcc-08b785601b847280652a0d05c3a06fa9c8d614dc.zip
gcc-08b785601b847280652a0d05c3a06fa9c8d614dc.tar.gz
gcc-08b785601b847280652a0d05c3a06fa9c8d614dc.tar.bz2
gccrs: minor changes (typo and minor refactor)
Fix a typo and merge 2 if clauses using the same condition. gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): Merge 2 if clauses. * backend/rust-compile-extern.h: Fix typo in comment. Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.cc')
-rw-r--r--gcc/rust/backend/rust-compile-expr.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index 6d88b39..929f3c0 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -1635,17 +1635,13 @@ CompileExpr::visit (HIR::CallExpr &expr)
return;
bool is_variadic = false;
- if (tyty->get_kind () == TyTy::TypeKind::FNDEF)
- {
- const TyTy::FnType *fn = static_cast<const TyTy::FnType *> (tyty);
- is_variadic = fn->is_variadic ();
- }
-
size_t required_num_args = expr.get_arguments ().size ();
+
if (tyty->get_kind () == TyTy::TypeKind::FNDEF)
{
const TyTy::FnType *fn = static_cast<const TyTy::FnType *> (tyty);
required_num_args = fn->num_params ();
+ is_variadic = fn->is_variadic ();
}
else if (tyty->get_kind () == TyTy::TypeKind::FNPTR)
{