From: Owen Avery Date: Wed, 2 Aug 2023 19:52:54 +0000 (-0400) Subject: gccrs: Remove Backend::bool_type and Backend::char_type X-Git-Tag: basepoints/gcc-15~2239 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79b52e69569552551abbcb8ee1436c819bce3979;p=thirdparty%2Fgcc.git gccrs: Remove Backend::bool_type and Backend::char_type gcc/rust/ChangeLog: * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Inline Backend::bool_type call. * rust-backend.h (Backend::bool_type): Remove. (Backend::char_type): Remove. (Gcc_backend::bool_type): Remove. (Gcc_backend::char_type): Remove. * rust-gcc.cc (Gcc_backend::char_constant_expression): Inline Backend::char_type call. Signed-off-by: Owen Avery --- diff --git a/gcc/rust/backend/rust-compile-type.cc b/gcc/rust/backend/rust-compile-type.cc index 11f2a2fef984..6482d6691389 100644 --- a/gcc/rust/backend/rust-compile-type.cc +++ b/gcc/rust/backend/rust-compile-type.cc @@ -440,10 +440,8 @@ TyTyResolveCompile::visit (const TyTy::SliceType &type) void TyTyResolveCompile::visit (const TyTy::BoolType &) { - translated - = ctx->get_backend ()->named_type ("bool", - ctx->get_backend ()->bool_type (), - BUILTINS_LOCATION); + translated = ctx->get_backend ()->named_type ("bool", boolean_type_node, + BUILTINS_LOCATION); } void diff --git a/gcc/rust/rust-backend.h b/gcc/rust/rust-backend.h index 66d17b338f7f..3674591bbd4a 100644 --- a/gcc/rust/rust-backend.h +++ b/gcc/rust/rust-backend.h @@ -70,12 +70,6 @@ public: // Types. - // Get the unnamed boolean type. - virtual tree bool_type () = 0; - - // Get the char type - virtual tree char_type () = 0; - // Get the wchar type virtual tree wchar_type () = 0; @@ -521,10 +515,6 @@ public: // Types. - tree bool_type () { return boolean_type_node; } - - tree char_type () { return char_type_node; } - tree wchar_type (); int get_pointer_size (); diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc index ced1e5471af8..673ddaaef1c6 100644 --- a/gcc/rust/rust-gcc.cc +++ b/gcc/rust/rust-gcc.cc @@ -873,7 +873,7 @@ Gcc_backend::wchar_constant_expression (wchar_t c) tree Gcc_backend::char_constant_expression (char c) { - return build_int_cst (this->char_type (), c); + return build_int_cst (char_type_node, c); } // Make a constant boolean expression.