]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Move label-related functions into base class Backend
authorOwen Avery <powerboat9.gamer@gmail.com>
Thu, 31 Aug 2023 15:32:11 +0000 (11:32 -0400)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:04:30 +0000 (19:04 +0100)
gcc/rust/ChangeLog:

* rust-backend.h
(Backend::label): Make non-virtual.
(Backend::label_definition_statement): Likewise.
(Backend::goto_statement): Likewise.
(Backend::label_address): Likewise.

(Gcc_backend::label): Remove.
(Gcc_backend::label_definition_statement): Remove.
(Gcc_backend::goto_statement): Remove.
(Gcc_backend::label_address): Remove.
* rust-gcc.cc
(Gcc_backend::label): Rename to ...
(Backend::label): ... here.
(Gcc_backend::label_definition_statement): Rename to ...
(Backend::label_definition_statement): ... here.
(Gcc_backend::goto_statement): Rename to ...
(Backend::goto_statement): ... here.
(Gcc_backend::label_address): Rename to ...
(Backend::label_address): ... here.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
gcc/rust/rust-backend.h
gcc/rust/rust-gcc.cc

index 1c81b20a8704a626e97d3e39d2aea0643791e9ac..21a913757d7c89d5b14bcd8ba93cd7db1a838a78 100644 (file)
@@ -416,20 +416,20 @@ public:
   // Create a new label.  NAME will be empty if this is a label
   // created by the frontend for a loop construct.  The location is
   // where the label is defined.
-  virtual tree label (tree, const std::string &name, location_t) = 0;
+  tree label (tree, const std::string &name, location_t);
 
   // Create a statement which defines a label.  This statement will be
   // put into the codestream at the point where the label should be
   // defined.
-  virtual tree label_definition_statement (tree) = 0;
+  tree label_definition_statement (tree);
 
   // Create a goto statement to a label.
-  virtual tree goto_statement (tree, location_t) = 0;
+  tree goto_statement (tree, location_t);
 
   // Create an expression for the address of a label.  This is used to
   // get the return address of a deferred function which may call
   // recover.
-  virtual tree label_address (tree, location_t) = 0;
+  tree label_address (tree, location_t);
 
   // Functions.
 
@@ -620,16 +620,6 @@ public:
   Bvariable *temporary_variable (tree, tree, tree, tree, bool, location_t,
                                 tree *);
 
-  // Labels.
-
-  tree label (tree, const std::string &name, location_t);
-
-  tree label_definition_statement (tree);
-
-  tree goto_statement (tree, location_t);
-
-  tree label_address (tree, location_t);
-
   // Functions.
 
   tree function (tree fntype, const std::string &name,
index 06bf7da246e7e5ef74203ef675f99acb91b54b3d..c3db37f288a1b2a342b6c96c09e882ee944b393c 100644 (file)
@@ -2243,8 +2243,7 @@ Gcc_backend::temporary_variable (tree fndecl, tree bind_tree, tree type_tree,
 // Make a label.
 
 tree
-Gcc_backend::label (tree func_tree, const std::string &name,
-                   location_t location)
+Backend::label (tree func_tree, const std::string &name, location_t location)
 {
   tree decl;
   if (name.empty ())
@@ -2270,7 +2269,7 @@ Gcc_backend::label (tree func_tree, const std::string &name,
 // Make a statement which defines a label.
 
 tree
-Gcc_backend::label_definition_statement (tree label)
+Backend::label_definition_statement (tree label)
 {
   return fold_build1_loc (DECL_SOURCE_LOCATION (label), LABEL_EXPR,
                          void_type_node, label);
@@ -2279,7 +2278,7 @@ Gcc_backend::label_definition_statement (tree label)
 // Make a goto statement.
 
 tree
-Gcc_backend::goto_statement (tree label, location_t location)
+Backend::goto_statement (tree label, location_t location)
 {
   return fold_build1_loc (location, GOTO_EXPR, void_type_node, label);
 }
@@ -2287,7 +2286,7 @@ Gcc_backend::goto_statement (tree label, location_t location)
 // Get the address of a label.
 
 tree
-Gcc_backend::label_address (tree label, location_t location)
+Backend::label_address (tree label, location_t location)
 {
   TREE_USED (label) = 1;
   TREE_ADDRESSABLE (label) = 1;