[vala/wip/transform: 79/107] Visit all nodes for transformation, not only the source ones



commit 16c95a2408fe0576115dc740221467ed7601fa55
Author: Luca Bruno <lucabru src gnome org>
Date:   Sat Feb 1 10:22:41 2014 +0100

    Visit all nodes for transformation, not only the source ones

 codegen/valaccodetransformer.vala | 6 +++++-
 vala/valacodetransformer.vala     | 9 +++------
 2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/codegen/valaccodetransformer.vala b/codegen/valaccodetransformer.vala
index 8e28b1f97..b63c20211 100644
--- a/codegen/valaccodetransformer.vala
+++ b/codegen/valaccodetransformer.vala
@@ -70,6 +70,10 @@ public class Vala.CCodeTransformer : CodeTransformer {
        }
 
        public override void visit_method (Method m) {
+               if (m.body == null) {
+                       return;
+               }
+
                m.accept_children (this);
        }
 
@@ -421,7 +425,7 @@ public class Vala.CCodeTransformer : CodeTransformer {
 
                Expression replacement = null;
                var old_parent_node = expr.parent_node;
-               var target_type = expr.target_type != null ? expr.target_type.copy () : null;
+               var target_type = copy_type (expr.target_type);
                push_builder (new CodeBuilder (context, parent_statement, expr.source_reference));
 
                if (context.analyzer.get_current_non_local_symbol (expr) is Block
diff --git a/vala/valacodetransformer.vala b/vala/valacodetransformer.vala
index 86e3a2d01..3e9f6ffae 100644
--- a/vala/valacodetransformer.vala
+++ b/vala/valacodetransformer.vala
@@ -54,12 +54,9 @@ public class Vala.CodeTransformer : CodeVisitor {
                /* we're only interested in non-pkg source files */
                var source_files = context.get_source_files ();
                foreach (SourceFile file in source_files) {
-                       if (file.file_type == SourceFileType.SOURCE ||
-                           (context.header_filename != null && file.file_type == SourceFileType.FAST)) {
-                               /* clear wrapper cache for every file */
-                               wrapper_cache = new HashMap<string, CodeNode> (str_hash, str_equal);
-                               file.accept (this);
-                       }
+                       /* clear wrapper cache for every file */
+                       wrapper_cache = new HashMap<string, CodeNode> (str_hash, str_equal);
+                       file.accept (this);
                }
        }
 


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