Big simplification and improvement of the entity collection system, reducing unneeded steps for packages

This commit is contained in:
gingerBill
2021-07-27 20:45:50 +01:00
parent 116e98b378
commit 9cd5ea59dd
7 changed files with 355 additions and 298 deletions

View File

@@ -5370,6 +5370,9 @@ bool parse_file(Parser *p, AstFile *f) {
}
f->total_file_decl_count += calc_decl_count(stmt);
if (stmt->kind == Ast_WhenStmt || stmt->kind == Ast_ExprStmt || stmt->kind == Ast_ImportDecl) {
f->delayed_decl_count += 1;
}
}
}
@@ -5381,6 +5384,10 @@ bool parse_file(Parser *p, AstFile *f) {
u64 end = time_stamp_time_now();
f->time_to_parse = cast(f64)(end-start)/cast(f64)time_stamp__freq();
for (int i = 0; i < AstDelayQueue_COUNT; i++) {
mpmc_init(f->delayed_decls_queues+i, heap_allocator(), f->delayed_decl_count);
}
return f->error_count == 0;
}