]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Remove Backend::bool_type and Backend::char_type
authorOwen Avery <powerboat9.gamer@gmail.com>
Wed, 2 Aug 2023 19:52:54 +0000 (15:52 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:00:28 +0000 (19:00 +0100)
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 <powerboat9.gamer@gmail.com>
gcc/rust/backend/rust-compile-type.cc
gcc/rust/rust-backend.h
gcc/rust/rust-gcc.cc

index 11f2a2fef9847674ffda129242318cef7bc94ad9..6482d66913899225bee531aa8bfaa18f0be0e1bb 100644 (file)
@@ -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
index 66d17b338f7fec3657a4b3e9b1c086026bbfc7d4..3674591bbd4a2ee5a1526b00ea40229e393bfce5 100644 (file)
@@ -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 ();
index ced1e5471af8f40bc6b8f30bbd6b09dd544d90a9..673ddaaef1c69e499083e465ce4ec109cd3741a4 100644 (file)
@@ -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.