From 9cd5ea59dd091083555d7aea691fcd889e67fb67 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Tue, 27 Jul 2021 20:45:50 +0100 Subject: Big simplification and improvement of the entity collection system, reducing unneeded steps for packages --- src/parser.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/parser.cpp') diff --git a/src/parser.cpp b/src/parser.cpp index f1f348ff4..afead99c6 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -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; } -- cgit v1.2.3