]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Replace in_creation_method field by property
authorJürg Billeter <j@bitron.ch>
Sun, 16 Aug 2009 10:23:40 +0000 (12:23 +0200)
committerJürg Billeter <j@bitron.ch>
Sun, 16 Aug 2009 10:23:40 +0000 (12:23 +0200)
codegen/valaccodebasemodule.vala
codegen/valaccodemethodmodule.vala

index aceec9a608bf18bb845acbba51e9c535eed71b60..0cfdb307b3734d1df8ce370fea1277c2281c4071 100644 (file)
@@ -127,7 +127,7 @@ internal class Vala.CCodeBaseModule : CCodeModule {
        Gee.Set<string> reserved_identifiers;
        
        public int next_temp_var_id = 0;
-       public bool in_creation_method = false;
+       public bool in_creation_method { get { return current_method is CreationMethod; } }
        public bool in_constructor = false;
        public bool in_static_or_class_ctor = false;
        public bool current_method_inner_error = false;
index 93150df80a3ea0fc163045fd08a4c57158eec23d..b9cdc1c30c564b8f1ce3074b1ef9f30791c7bce4 100644 (file)
@@ -185,7 +185,6 @@ internal class Vala.CCodeMethodModule : CCodeStructModule {
        public override void visit_method (Method m) {
                var old_symbol = current_symbol;
                bool old_method_inner_error = current_method_inner_error;
-               bool old_in_creation_method = in_creation_method;
                int old_next_temp_var_id = next_temp_var_id;
                var old_temp_vars = temp_vars;
                var old_temp_ref_vars = temp_ref_vars;
@@ -205,7 +204,6 @@ internal class Vala.CCodeMethodModule : CCodeStructModule {
                check_type (m.return_type);
 
                if (m is CreationMethod) {
-                       in_creation_method = true;
                        var cl = current_type_symbol as Class;
                        if (cl != null && !cl.is_compact) {
                                if (cl.base_class == null) {
@@ -214,8 +212,6 @@ internal class Vala.CCodeMethodModule : CCodeStructModule {
                                        in_gobject_creation_method = true;
                                }
                        }
-               } else {
-                       in_creation_method = false;
                }
 
                var creturn_type = current_return_type;
@@ -290,8 +286,6 @@ internal class Vala.CCodeMethodModule : CCodeStructModule {
 
                                m.body.ccodenode = cblock;
                        }
-
-                       in_creation_method = old_in_creation_method;
                }
 
                bool inner_error = current_method_inner_error;