From: Sriram Raghunathan <[email protected]>

This patch removes the function_defer_statement, this is a feature
available in go and rust doesn't support this.

gcc/rust/ChangeLog:

        * rust-backend.h (function_defer_statement): Remove.
        * rust-gcc.cc (function_defer_statement): Remove.

Signed-off-by: Sriram Raghunathan <[email protected]>
---
This change was merged into the gccrs repository and is posted here for
upstream visibility and potential drive-by review, as requested by GCC
release managers.
Each commit email contains a link to its details on github from where you can
find the Pull-Request and associated discussions.


Commit on github: 
https://github.com/Rust-GCC/gccrs/commit/ea402b0a668d490c6b73ba63715a82fd2629e1dd

The commit has NOT been mentioned in any issue.

The commit has been mentioned in the following pull-request(s):
 - https://github.com/Rust-GCC/gccrs/pull/5029

 gcc/rust/rust-backend.h |  7 -------
 gcc/rust/rust-gcc.cc    | 35 -----------------------------------
 2 files changed, 42 deletions(-)

diff --git a/gcc/rust/rust-backend.h b/gcc/rust/rust-backend.h
index ecd868362..e3013cbb3 100644
--- a/gcc/rust/rust-backend.h
+++ b/gcc/rust/rust-backend.h
@@ -431,13 +431,6 @@ static const unsigned int function_in_unique_section = 1 
<< 3;
 tree function (tree fntype, GGC::Ident name, tl::optional<GGC::Ident> asm_name,
               unsigned int flags, location_t);
 
-// Create a statement that runs all deferred calls for FUNCTION.  This should
-// be a statement that looks like this in C++:
-//   finish:
-//     try { DEFER_RETURN; } catch { CHECK_DEFER; goto finish; }
-tree function_defer_statement (tree function, tree undefer, tree check_defer,
-                              location_t);
-
 // Record PARAM_VARS as the variables to use for the parameters of FUNCTION.
 // This will only be called for a function definition.  Returns true on
 // success, false on failure.
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc
index b3e5a5cdd..00df8b3b9 100644
--- a/gcc/rust/rust-gcc.cc
+++ b/gcc/rust/rust-gcc.cc
@@ -2388,41 +2388,6 @@ function (tree functype, GGC::Ident name, 
tl::optional<GGC::Ident> asm_name,
   return decl;
 }
 
-// Create a statement that runs all deferred calls for FUNCTION.  This should
-// be a statement that looks like this in C++:
-//   finish:
-//     try { UNDEFER; } catch { CHECK_DEFER; goto finish; }
-
-tree
-function_defer_statement (tree function, tree undefer_tree, tree defer_tree,
-                         location_t location)
-{
-  if (error_operand_p (undefer_tree) || error_operand_p (defer_tree)
-      || error_operand_p (function))
-    return error_mark_node;
-
-  if (DECL_STRUCT_FUNCTION (function) == NULL)
-    push_struct_function (function);
-  else
-    push_cfun (DECL_STRUCT_FUNCTION (function));
-
-  tree stmt_list = NULL;
-  tree label = Backend::label (function, tl::nullopt, location);
-  tree label_def = label_definition_statement (label);
-  append_to_statement_list (label_def, &stmt_list);
-
-  tree jump_stmt = goto_statement (label, location);
-  tree catch_body
-    = build2 (COMPOUND_EXPR, void_type_node, defer_tree, jump_stmt);
-  catch_body = build2 (CATCH_EXPR, void_type_node, NULL, catch_body);
-  tree try_catch
-    = build2 (TRY_CATCH_EXPR, void_type_node, undefer_tree, catch_body);
-  append_to_statement_list (try_catch, &stmt_list);
-  pop_cfun ();
-
-  return stmt_list;
-}
-
 // Record PARAM_VARS as the variables to use for the parameters of FUNCTION.
 // This will only be called for a function definition.
 

base-commit: 1bef66052c5ad9ecea86a540bd3766083c5b0e71
-- 
2.56.0

Reply via email to