Skip to content

Commit 83feca3

Browse files
powerboat9CohenArthur
authored andcommitted
gccrs: Move block-related methods into base class Backend
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 <[email protected]>
1 parent b1c722d commit 83feca3

File tree

2 files changed

+9
-17
lines changed

2 files changed

+9
-17
lines changed

gcc/rust/rust-backend.h

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,15 @@ class Backend
326326
// the initial curly brace. END_LOCATION is the location of the end
327327
// of the block, more or less the location of the final curly brace.
328328
// The statements will be added after the block is created.
329-
virtual tree block (tree function, tree enclosing,
330-
const std::vector<Bvariable *> &vars,
331-
location_t start_location, location_t end_location)
332-
= 0;
329+
tree block (tree function, tree enclosing,
330+
const std::vector<Bvariable *> &vars, location_t start_location,
331+
location_t end_location);
333332

334333
// Add the statements to a block. The block is created first. Then
335334
// the statements are created. Then the statements are added to the
336335
// block. This will called exactly once per block. The vector may
337336
// be empty if there are no statements.
338-
virtual void block_add_statements (tree, const std::vector<tree> &) = 0;
337+
void block_add_statements (tree, const std::vector<tree> &);
339338

340339
// Variables.
341340

@@ -536,13 +535,6 @@ class Gcc_backend : public Backend
536535

537536
tree call_expression (tree fn, const std::vector<tree> &args,
538537
tree static_chain, location_t);
539-
540-
// Blocks.
541-
542-
tree block (tree, tree, const std::vector<Bvariable *> &, location_t,
543-
location_t);
544-
545-
void block_add_statements (tree, const std::vector<tree> &);
546538
};
547539

548540
#endif // RUST_BACKEND_H

gcc/rust/rust-gcc.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,9 +1867,9 @@ Backend::statement_list (const std::vector<tree> &statements)
18671867
// the Bblock.
18681868

18691869
tree
1870-
Gcc_backend::block (tree fndecl, tree enclosing,
1871-
const std::vector<Bvariable *> &vars,
1872-
location_t start_location, location_t)
1870+
Backend::block (tree fndecl, tree enclosing,
1871+
const std::vector<Bvariable *> &vars, location_t start_location,
1872+
location_t)
18731873
{
18741874
tree block_tree = make_node (BLOCK);
18751875
if (enclosing == NULL)
@@ -1928,8 +1928,8 @@ Gcc_backend::block (tree fndecl, tree enclosing,
19281928
// Add statements to a block.
19291929

19301930
void
1931-
Gcc_backend::block_add_statements (tree bind_tree,
1932-
const std::vector<tree> &statements)
1931+
Backend::block_add_statements (tree bind_tree,
1932+
const std::vector<tree> &statements)
19331933
{
19341934
tree stmt_list = NULL_TREE;
19351935
for (std::vector<tree>::const_iterator p = statements.begin ();

0 commit comments

Comments
 (0)