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

* rust-backend.h
(Backend::block): Make non-virtual.
(Backend::block_add_statements): Likewise.

(Gcc_backend::block): Remove.
(Gcc_backend::block_add_statements): Remove.
* rust-gcc.cc
(Gcc_backend::block): Rename to ...
(Backend::block): ... here.
(Gcc_backend::block_add_statements): Rename to ...
(Backend::block_add_statements): ... here.

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

index 6b265cccde1259312edfc5e0114d76881d2f1568..082f6b977f99495bd7ad67690d8ab0829e566312 100644 (file)
@@ -326,16 +326,15 @@ public:
   // the initial curly brace.  END_LOCATION is the location of the end
   // of the block, more or less the location of the final curly brace.
   // The statements will be added after the block is created.
-  virtual tree block (tree function, tree enclosing,
-                     const std::vector<Bvariable *> &vars,
-                     location_t start_location, location_t end_location)
-    = 0;
+  tree block (tree function, tree enclosing,
+             const std::vector<Bvariable *> &vars, location_t start_location,
+             location_t end_location);
 
   // Add the statements to a block.  The block is created first.  Then
   // the statements are created.  Then the statements are added to the
   // block.  This will called exactly once per block.  The vector may
   // be empty if there are no statements.
-  virtual void block_add_statements (tree, const std::vector<tree> &) = 0;
+  void block_add_statements (tree, const std::vector<tree> &);
 
   // Variables.
 
@@ -536,13 +535,6 @@ public:
 
   tree call_expression (tree fn, const std::vector<tree> &args,
                        tree static_chain, location_t);
-
-  // Blocks.
-
-  tree block (tree, tree, const std::vector<Bvariable *> &, location_t,
-             location_t);
-
-  void block_add_statements (tree, const std::vector<tree> &);
 };
 
 #endif // RUST_BACKEND_H
index 7ef442b91ed878941de350f74f48f79de7fe6a65..330772f9313f6dfbe80170faf0f76ce911ca8e7a 100644 (file)
@@ -1867,9 +1867,9 @@ Backend::statement_list (const std::vector<tree> &statements)
 // the Bblock.
 
 tree
-Gcc_backend::block (tree fndecl, tree enclosing,
-                   const std::vector<Bvariable *> &vars,
-                   location_t start_location, location_t)
+Backend::block (tree fndecl, tree enclosing,
+               const std::vector<Bvariable *> &vars, location_t start_location,
+               location_t)
 {
   tree block_tree = make_node (BLOCK);
   if (enclosing == NULL)
@@ -1928,8 +1928,8 @@ Gcc_backend::block (tree fndecl, tree enclosing,
 // Add statements to a block.
 
 void
-Gcc_backend::block_add_statements (tree bind_tree,
-                                  const std::vector<tree> &statements)
+Backend::block_add_statements (tree bind_tree,
+                              const std::vector<tree> &statements)
 {
   tree stmt_list = NULL_TREE;
   for (std::vector<tree>::const_iterator p = statements.begin ();