[vala/wip/transform] transformer: Clear wrapper cache for every file



commit 0c4281c46cc2406aaffcdae515d95974bf6e5615
Author: Luca Bruno <lucabru src gnome org>
Date:   Thu Oct 25 20:32:48 2012 +0200

    transformer: Clear wrapper cache for every file

 codegen/valaccodetransformer.vala |    4 ----
 vala/valacodetransformer.vala     |    5 +++--
 2 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/codegen/valaccodetransformer.vala b/codegen/valaccodetransformer.vala
index 947727a..2ba14a0 100644
--- a/codegen/valaccodetransformer.vala
+++ b/codegen/valaccodetransformer.vala
@@ -28,10 +28,6 @@ public class Vala.CCodeTransformer : CodeTransformer {
 		source_file.accept_children (this);
 	}
 
-	public override void visit_namespace (Namespace ns) {
-		ns.accept_children (this);
-	}
-
 	public override void visit_class (Class cl) {
 		cl.accept_children (this);
 	}
diff --git a/vala/valacodetransformer.vala b/vala/valacodetransformer.vala
index 8ff5b80..8773d51 100644
--- a/vala/valacodetransformer.vala
+++ b/vala/valacodetransformer.vala
@@ -28,7 +28,7 @@ public class Vala.CodeTransformer : CodeVisitor {
 
 	public CodeBuilder b;
 	public ArrayList<CodeBuilder> builder_stack = new ArrayList<CodeBuilder> ();
-	public HashMap<string, CodeNode> wrapper_cache = new HashMap<string, CodeNode> (str_hash, str_equal);
+	public HashMap<string, CodeNode> wrapper_cache;
 
 	public void push_builder (CodeBuilder builder) {
 		builder_stack.add (b);
@@ -47,12 +47,13 @@ public class Vala.CodeTransformer : CodeVisitor {
 	 */
 	public void transform (CodeContext context) {
 		this.context = context;
-
 		/* 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);
 			}
 		}



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