aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-09-08 15:40:28 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 19:04:35 +0100
commitf538c29d78646c060e391770b6e5e821b99c7685 (patch)
tree50136a9d37b06f382e161d5ca0b4ae1fde1c460e /gcc
parent15648d5b8dc5a8cab1b11e14e5e5c178e32ed366 (diff)
downloadgcc-f538c29d78646c060e391770b6e5e821b99c7685.zip
gcc-f538c29d78646c060e391770b6e5e821b99c7685.tar.gz
gcc-f538c29d78646c060e391770b6e5e821b99c7685.tar.bz2
gccrs: Shorten `make_unsigned_long_tree` code and remove `Backend::integer_constant_expression`
gcc/rust/ChangeLog: * backend/rust-compile-intrinsic.cc: Simplify `make_unsigned_long_tree` * rust-backend.h: Remove `integer_constant_expression` * rust-gcc.cc: Remove `integer_constant_expression`
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/backend/rust-compile-intrinsic.cc5
-rw-r--r--gcc/rust/rust-backend.h4
-rw-r--r--gcc/rust/rust-gcc.cc13
3 files changed, 1 insertions, 21 deletions
diff --git a/gcc/rust/backend/rust-compile-intrinsic.cc b/gcc/rust/backend/rust-compile-intrinsic.cc
index 2f8bc49..243aab7 100644
--- a/gcc/rust/backend/rust-compile-intrinsic.cc
+++ b/gcc/rust/backend/rust-compile-intrinsic.cc
@@ -736,10 +736,7 @@ copy_nonoverlapping_handler (Context *ctx, TyTy::FnType *fntype)
static tree
make_unsigned_long_tree (unsigned long value)
{
- mpz_t mpz_value;
- mpz_init_set_ui (mpz_value, value);
-
- return Backend::integer_constant_expression (integer_type_node, mpz_value);
+ return build_int_cst (integer_type_node, value);
}
static tree
diff --git a/gcc/rust/rust-backend.h b/gcc/rust/rust-backend.h
index 25dd370..3aec681 100644
--- a/gcc/rust/rust-backend.h
+++ b/gcc/rust/rust-backend.h
@@ -182,10 +182,6 @@ tree zero_expression (tree);
tree
var_expression (Bvariable *var, location_t);
-// Return an expression for the multi-precision integer VAL in BTYPE.
-tree
-integer_constant_expression (tree btype, mpz_t val);
-
// Return an expression for the floating point value VAL in BTYPE.
tree
float_constant_expression (tree btype, mpfr_t val);
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc
index 1aca71f..88bdca1 100644
--- a/gcc/rust/rust-gcc.cc
+++ b/gcc/rust/rust-gcc.cc
@@ -800,19 +800,6 @@ Backend::var_expression (Bvariable *var, location_t location)
return var->get_tree (location);
}
-// Return a typed value as a constant integer.
-// This function does not release the memory of @val
-
-tree
-Backend::integer_constant_expression (tree t, mpz_t val)
-{
- if (t == error_mark_node)
- return error_mark_node;
-
- tree ret = wide_int_to_tree (t, wi::from_mpz (t, val, true));
- return ret;
-}
-
// Return a typed value as a constant floating-point number.
tree