Remove clutter parameters and begin parallelizing the type checker

This commit is contained in:
gingerBill
2018-05-28 18:46:39 +01:00
parent 642aa0bc4b
commit 619783ca1b
7 changed files with 204 additions and 91 deletions
+3 -3
View File
@@ -501,7 +501,7 @@ bool check_using_stmt_entity(CheckerContext *ctx, AstNodeUsingStmt *us, AstNode
Type *t = base_type(type_deref(e->type));
if (t->kind == Type_Struct) {
// TODO(bill): Make it work for unions too
Scope *found = scope_of_node(&ctx->checker->info, t->Struct.node);
Scope *found = scope_of_node(t->Struct.node);
for_array(i, found->elements.entries) {
Entity *f = found->elements.entries[i].value;
if (f->kind == Entity_Variable) {
@@ -1685,7 +1685,7 @@ void check_stmt_internal(CheckerContext *ctx, AstNode *node, u32 flags) {
Type *t = base_type(type_deref(e->type));
if (t->kind == Type_Struct) {
// TODO(bill): Make it work for unions too
Scope *found = scope_of_node(&ctx->checker->info, t->Struct.node);
Scope *found = scope_of_node(t->Struct.node);
for_array(list_index, uis->list) {
AstNode *node = uis->list[list_index];
ast_node(ident, Ident, node);
@@ -1933,7 +1933,7 @@ void check_stmt_internal(CheckerContext *ctx, AstNode *node, u32 flags) {
if (is_blank_ident(name)) {
error(token, "'using' cannot be applied variable declared as '_'");
} else if (is_type_struct(t) || is_type_raw_union(t)) {
Scope *scope = scope_of_node(&ctx->checker->info, t->Struct.node);
Scope *scope = scope_of_node(t->Struct.node);
for_array(i, scope->elements.entries) {
Entity *f = scope->elements.entries[i].value;
if (f->kind == Entity_Variable) {