From: Rico Tzschichholz Date: Mon, 13 Jul 2020 18:00:08 +0000 (+0200) Subject: codegen: Make use of CCode.cname for label name of CatchClause X-Git-Tag: 0.49.1~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f1d443b9bfa54232ffa6d7131f4b0c498e82031;p=thirdparty%2Fvala.git codegen: Make use of CCode.cname for label name of CatchClause --- diff --git a/codegen/valagerrormodule.vala b/codegen/valagerrormodule.vala index 79a96c47f..fedc424ae 100644 --- a/codegen/valagerrormodule.vala +++ b/codegen/valagerrormodule.vala @@ -218,7 +218,7 @@ public class Vala.GErrorModule : CCodeDelegateModule { if (clause.error_type.equals (gerror_type)) { // general catch clause, this should be the last one has_general_catch_clause = true; - ccode.add_goto (clause.clabel_name); + ccode.add_goto (clause.get_attribute_string ("CCode", "cname")); break; } else { var catch_type = clause.error_type as ErrorType; @@ -241,7 +241,7 @@ public class Vala.GErrorModule : CCodeDelegateModule { } // go to catch clause if error domain matches - ccode.add_goto (clause.clabel_name); + ccode.add_goto (clause.get_attribute_string ("CCode", "cname")); ccode.close (); } } @@ -316,7 +316,7 @@ public class Vala.GErrorModule : CCodeDelegateModule { is_in_catch = true; foreach (CatchClause clause in stmt.get_catch_clauses ()) { - clause.clabel_name = "__catch%d_%s".printf (this_try_id, get_ccode_lower_case_name (clause.error_type)); + clause.set_attribute_string ("CCode", "cname", "__catch%d_%s".printf (this_try_id, get_ccode_lower_case_name (clause.error_type))); } is_in_catch = false; @@ -356,7 +356,7 @@ public class Vala.GErrorModule : CCodeDelegateModule { generate_error_domain_declaration (error_type.error_domain, cfile); } - ccode.add_label (clause.clabel_name); + ccode.add_label (clause.get_attribute_string ("CCode", "cname")); ccode.open_block (); diff --git a/vala/valacatchclause.vala b/vala/valacatchclause.vala index 1ff942116..524d3909f 100644 --- a/vala/valacatchclause.vala +++ b/vala/valacatchclause.vala @@ -65,11 +65,6 @@ public class Vala.CatchClause : CodeNode { } } - /** - * Specifies the label used for this catch clause in the C code. - */ - public string? clabel_name { get; set; } - private DataType _data_type; private Block _body;