[vala/wip/transform: 76/132] Don't navigate the resolver tree if a node has been checked already



commit ac40481191622658821c5def23310420d847447a
Author: Luca Bruno <lucabru src gnome org>
Date:   Thu Jan 5 15:56:43 2012 +0100

    Don't navigate the resolver tree if a node has been checked already

 vala/valasymbolresolver.vala |  174 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 174 insertions(+), 0 deletions(-)
---
diff --git a/vala/valasymbolresolver.vala b/vala/valasymbolresolver.vala
index 55fa94f..61002e8 100644
--- a/vala/valasymbolresolver.vala
+++ b/vala/valasymbolresolver.vala
@@ -57,6 +57,10 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_class (Class cl) {
+               if (cl.checked) {
+                       return;
+               }
+
                current_scope = cl.scope;
 
                cl.accept_children (this);
@@ -82,6 +86,10 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_struct (Struct st) {
+               if (st.checked) {
+                       return;
+               }
+
                current_scope = st.scope;
 
                st.accept_children (this);
@@ -101,6 +109,10 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_interface (Interface iface) {
+               if (iface.checked) {
+                       return;
+               }
+
                current_scope = iface.scope;
 
                iface.accept_children (this);
@@ -117,6 +129,10 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_enum (Enum en) {
+               if (en.checked) {
+                       return;
+               }
+
                current_scope = en.scope;
 
                en.accept_children (this);
@@ -125,6 +141,10 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_error_domain (ErrorDomain ed) {
+               if (ed.checked) {
+                       return;
+               }
+
                current_scope = ed.scope;
 
                ed.accept_children (this);
@@ -133,6 +153,10 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_delegate (Delegate cb) {
+               if (cb.checked) {
+                       return;
+               }
+
                current_scope = cb.scope;
 
                cb.accept_children (this);
@@ -141,6 +165,10 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_constant (Constant c) {
+               if (c.checked) {
+                       return;
+               }
+
                var old_scope = current_scope;
                if (!(c.parent_symbol is Block)) {
                        // non-local constant
@@ -153,6 +181,10 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_field (Field f) {
+               if (f.checked) {
+                       return;
+               }
+
                current_scope = f.scope;
 
                f.accept_children (this);
@@ -161,6 +193,10 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_method (Method m) {
+               if (m.checked) {
+                       return;
+               }
+
                current_scope = m.scope;
 
                m.accept_children (this);
@@ -169,34 +205,58 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_creation_method (CreationMethod m) {
+               if (m.checked) {
+                       return;
+               }
                m.accept_children (this);
        }
 
        public override void visit_formal_parameter (Parameter p) {
+               if (p.checked) {
+                       return;
+               }
                p.accept_children (this);
        }
 
        public override void visit_property (Property prop) {
+               if (prop.checked) {
+                       return;
+               }
                prop.accept_children (this);
        }
 
        public override void visit_property_accessor (PropertyAccessor acc) {
+               if (acc.checked) {
+                       return;
+               }
                acc.accept_children (this);
        }
 
        public override void visit_signal (Signal sig) {
+               if (sig.checked) {
+                       return;
+               }
                sig.accept_children (this);
        }
 
        public override void visit_constructor (Constructor c) {
+               if (c.checked) {
+                       return;
+               }
                c.accept_children (this);
        }
 
        public override void visit_destructor (Destructor d) {
+               if (d.checked) {
+                       return;
+               }
                d.accept_children (this);
        }
 
        public override void visit_block (Block b) {
+               if (b.checked) {
+                       return;
+               }
                b.accept_children (this);
        }
 
@@ -380,10 +440,16 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_declaration_statement (DeclarationStatement stmt) {
+               if (stmt.checked) {
+                       return;
+               }
                stmt.accept_children (this);
        }
 
        public override void visit_local_variable (LocalVariable local) {
+               if (local.checked) {
+                       return;
+               }
                local.accept_children (this);
                if (!context.experimental_non_null) {
                        // local reference variables are considered nullable
@@ -400,62 +466,107 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_initializer_list (InitializerList list) {
+               if (list.checked) {
+                       return;
+               }
                list.accept_children (this);
        }
 
        public override void visit_expression_statement (ExpressionStatement stmt) {
+               if (stmt.checked) {
+                       return;
+               }
                stmt.accept_children (this);
        }
 
        public override void visit_if_statement (IfStatement stmt) {
+               if (stmt.checked) {
+                       return;
+               }
                stmt.accept_children (this);
        }
 
        public override void visit_switch_statement (SwitchStatement stmt) {
+               if (stmt.checked) {
+                       return;
+               }
                stmt.accept_children (this);
        }
 
        public override void visit_switch_section (SwitchSection section) {
+               if (section.checked) {
+                       return;
+               }
                section.accept_children (this);
        }
 
        public override void visit_switch_label (SwitchLabel label) {
+               if (label.checked) {
+                       return;
+               }
                label.accept_children (this);
        }
 
        public override void visit_loop (Loop stmt) {
+               if (stmt.checked) {
+                       return;
+               }
                stmt.accept_children (this);
        }
 
        public override void visit_while_statement (WhileStatement stmt) {
+               if (stmt.checked) {
+                       return;
+               }
                stmt.accept_children (this);
        }
 
        public override void visit_do_statement (DoStatement stmt) {
+               if (stmt.checked) {
+                       return;
+               }
                stmt.accept_children (this);
        }
 
        public override void visit_for_statement (ForStatement stmt) {
+               if (stmt.checked) {
+                       return;
+               }
                stmt.accept_children (this);
        }
 
        public override void visit_foreach_statement (ForeachStatement stmt) {
+               if (stmt.checked) {
+                       return;
+               }
                stmt.accept_children (this);
        }
 
        public override void visit_return_statement (ReturnStatement stmt) {
+               if (stmt.checked) {
+                       return;
+               }
                stmt.accept_children (this);
        }
 
        public override void visit_yield_statement (YieldStatement stmt) {
+               if (stmt.checked) {
+                       return;
+               }
                stmt.accept_children (this);
        }
 
        public override void visit_throw_statement (ThrowStatement stmt) {
+               if (stmt.checked) {
+                       return;
+               }
                stmt.accept_children (this);
        }
 
        public override void visit_try_statement (TryStatement stmt) {
+               if (stmt.checked) {
+                       return;
+               }
                stmt.accept_children (this);
        }
 
@@ -464,58 +575,100 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_catch_clause (CatchClause clause) {
+               if (clause.checked) {
+                       return;
+               }
                clause.accept_children (this);
        }
 
        public override void visit_array_creation_expression (ArrayCreationExpression e) {
+               if (e.checked) {
+                       return;
+               }
                e.accept_children (this);
        }
 
        public override void visit_template (Template tmpl) {
+               if (tmpl.checked) {
+                       return;
+               }
                tmpl.accept_children (this);
        }
 
        public override void visit_tuple (Tuple tuple) {
+               if (tuple.checked) {
+                       return;
+               }
                tuple.accept_children (this);
        }
 
        public override void visit_member_access (MemberAccess expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_method_call (MethodCall expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_element_access (ElementAccess expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_slice_expression (SliceExpression expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_postfix_expression (PostfixExpression expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_object_creation_expression (ObjectCreationExpression expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_sizeof_expression (SizeofExpression expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_typeof_expression (TypeofExpression expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_unary_expression (UnaryExpression expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_cast_expression (CastExpression expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
@@ -524,30 +677,51 @@ public class Vala.SymbolResolver : CodeVisitor {
        }
 
        public override void visit_addressof_expression (AddressofExpression expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_reference_transfer_expression (ReferenceTransferExpression expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_binary_expression (BinaryExpression expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_type_check (TypeCheck expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_conditional_expression (ConditionalExpression expr) {
+               if (expr.checked) {
+                       return;
+               }
                expr.accept_children (this);
        }
 
        public override void visit_lambda_expression (LambdaExpression l) {
+               if (l.checked) {
+                       return;
+               }
                l.accept_children (this);
        }
 
        public override void visit_assignment (Assignment a) {
+               if (a.checked) {
+                       return;
+               }
                a.accept_children (this);
        }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]