[vala/staging] Revert "codegen: Don't append unreachable clean-up section of Block"
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] Revert "codegen: Don't append unreachable clean-up section of Block"
- Date: Mon, 17 Aug 2020 15:23:40 +0000 (UTC)
commit 6a04c4606a8e2d717d6a7a7d0956fa2887510f3e
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Mon Aug 17 16:33:44 2020 +0200
Revert "codegen: Don't append unreachable clean-up section of Block"
This reverts commit 8f3a0a0b64e0c7fbcc9231c3058247920dd6eeda.
codegen/valaccodebasemodule.vala | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 1720340ce..ca9362e05 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -2412,13 +2412,7 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
}
}
- bool unreachable_exit_block = false;
- if (b.parent_symbol is Subroutine) {
- unowned BasicBlock? exit_block = ((Subroutine) b.parent_symbol).exit_block;
- unreachable_exit_block = (exit_block == null || exit_block.get_predecessors ().size
<= 0);
- }
-
- if (!unreachable_exit_block && b.parent_symbol is Method) {
+ if (b.parent_symbol is Method) {
var m = (Method) b.parent_symbol;
foreach (Parameter param in m.get_parameters ()) {
if (!param.captured && !param.ellipsis && !param.params_array &&
requires_destroy (param.variable_type) && param.direction == ParameterDirection.IN) {
@@ -2427,14 +2421,14 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
return_out_parameter (param);
}
}
- } else if (!unreachable_exit_block && b.parent_symbol is PropertyAccessor) {
+ } else if (b.parent_symbol is PropertyAccessor) {
var acc = (PropertyAccessor) b.parent_symbol;
if (acc.value_parameter != null && !acc.value_parameter.captured && requires_destroy
(acc.value_parameter.variable_type)) {
ccode.add_expression (destroy_parameter (acc.value_parameter));
}
}
- if (!unreachable_exit_block && b.captured) {
+ if (b.captured) {
int block_id = get_block_id (b);
var data_unref = new CCodeFunctionCall (new CCodeIdentifier
("block%d_data_unref".printf (block_id)));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]