Generic procedures generate types on use

This commit is contained in:
Ginger Bill
2017-06-25 19:41:07 +01:00
parent c4081393c1
commit 15dbea6899
6 changed files with 247 additions and 171 deletions
+3 -3
View File
@@ -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) ||