aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Poulhiès <dkm@kataplop.net>2023-10-14 00:02:47 +0200
committerMarc Poulhiès <dkm@kataplop.net>2023-10-16 12:19:17 +0000
commit7292e71b61d95c0cec8378555e71a11a6e4120c0 (patch)
tree8b501d83ce2973371d67e404bd4f3b4f92169f60
parent007166ca6ceecd429f7033336af25dd679424ca2 (diff)
downloadgcc-7292e71b61d95c0cec8378555e71a11a6e4120c0.zip
gcc-7292e71b61d95c0cec8378555e71a11a6e4120c0.tar.gz
gcc-7292e71b61d95c0cec8378555e71a11a6e4120c0.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>
-rw-r--r--gcc/rust/backend/rust-compile-expr.cc8
-rw-r--r--gcc/rust/backend/rust-compile-extern.h6
2 files changed, 4 insertions, 10 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index bd91c91..1f0b58e 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)
{
diff --git a/gcc/rust/backend/rust-compile-extern.h b/gcc/rust/backend/rust-compile-extern.h
index be92529..1df3875 100644
--- a/gcc/rust/backend/rust-compile-extern.h
+++ b/gcc/rust/backend/rust-compile-extern.h
@@ -115,10 +115,8 @@ public:
}
if (fntype->has_substitutions_defined ())
- {
- // override the Hir Lookups for the substituions in this context
- fntype->override_context ();
- }
+ // override the HIR lookups for the substitutions in this context
+ fntype->override_context ();
if (fntype->get_abi () == ABI::INTRINSIC)
{