Browse Source

Fix: double declaration in SSA

Ginger Bill 9 years ago
parent
commit
6088cbeddb
3 changed files with 5 additions and 3 deletions
  1. 0 3
      code/demo.odin
  2. 4 0
      src/codegen/codegen.cpp
  3. 1 0
      src/common.cpp

+ 0 - 3
code/demo.odin

@@ -1,8 +1,5 @@
 #import "fmt.odin"
 #import "fmt.odin"
-#import "game.odin"
 
 
 main :: proc() {
 main :: proc() {
 	fmt.println("Hello")
 	fmt.println("Hello")
-	game.run()
-
 }
 }

+ 4 - 0
src/codegen/codegen.cpp

@@ -116,6 +116,10 @@ void ssa_gen_tree(ssaGen *s) {
 		DeclInfo *decl = entry->value;
 		DeclInfo *decl = entry->value;
 		Scope *scope = e->scope;
 		Scope *scope = e->scope;
 
 
+		if (!scope->is_file) {
+			continue;
+		}
+
 		if (entry_point != NULL) {
 		if (entry_point != NULL) {
 			auto found = map_get(&min_dep_map, hash_pointer(e));
 			auto found = map_get(&min_dep_map, hash_pointer(e));
 			if (found == NULL) {
 			if (found == NULL) {

+ 1 - 0
src/common.cpp

@@ -196,6 +196,7 @@ template <typename T> void  multi_map_remove_all(Map<T> *h, HashKey key);
 
 
 
 
 
 
+
 template <typename T>
 template <typename T>
 gb_inline void map_init(Map<T> *h, gbAllocator a) {
 gb_inline void map_init(Map<T> *h, gbAllocator a) {
 	gb_array_init(h->hashes,  a);
 	gb_array_init(h->hashes,  a);