From 15dbea6899fd1e918f4ea0dc91045e0dc460657e Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 25 Jun 2017 19:41:07 +0100 Subject: Generic procedures generate types on use --- src/checker.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/checker.cpp') diff --git a/src/checker.cpp b/src/checker.cpp index 66fcc1ab6..5fe030331 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -221,6 +221,7 @@ ExprInfo make_expr_info(bool is_lhs, AddressingMode mode, Type *type, ExactValue struct Scope { + AstNode * node; Scope * parent; Scope * prev, *next; Scope * first_child; @@ -241,8 +242,6 @@ gb_global Scope *universal_scope = NULL; - - struct DelayedDecl { Scope * parent; AstNode *decl; @@ -278,6 +277,7 @@ struct CheckerInfo { Map entities; // Key: Entity * Map foreigns; // Key: String Map files; // Key: String (full path) + Map type_info_map; // Key: Type * isize type_info_count; }; @@ -423,12 +423,12 @@ void destroy_scope(Scope *scope) { void add_scope(Checker *c, AstNode *node, Scope *scope) { GB_ASSERT(node != NULL); GB_ASSERT(scope != NULL); + scope->node = node; map_set(&c->info.scopes, hash_node(node), scope); } void check_open_scope(Checker *c, AstNode *node) { - GB_ASSERT(node != NULL); node = unparen_expr(node); GB_ASSERT(node->kind == AstNode_Invalid || is_ast_node_stmt(node) || -- cgit v1.2.3