aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-06-25 19:41:07 +0100
committerGinger Bill <bill@gingerbill.org>2017-06-25 19:41:07 +0100
commit15dbea6899fd1e918f4ea0dc91045e0dc460657e (patch)
treefcab772d248079a5cceffc47ccf84bb928809670 /src/checker.cpp
parentc4081393c1ca0b1c259cdba572b32c266bc53c5c (diff)
Generic procedures generate types on use
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp6
1 files changed, 3 insertions, 3 deletions
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<DeclInfo *> entities; // Key: Entity *
Map<Entity *> foreigns; // Key: String
Map<AstFile *> files; // Key: String (full path)
+
Map<isize> 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) ||