From 4ded42a33b2427e2d8b850422f4e1c1798ce4df1 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Tue, 13 Jul 2021 17:24:20 +0100 Subject: Split up cycle check and adding type info timings --- src/checker.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/checker.cpp') diff --git a/src/checker.cpp b/src/checker.cpp index 1ec4ed29a..aa2aa2494 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -4674,12 +4674,7 @@ void check_parsed_files(Checker *c) { for_array(i, c->info.definitions) { Entity *e = c->info.definitions[i]; if (e->kind == Entity_TypeName && e->type != nullptr) { - // i64 size = type_size_of(c->allocator, e->type); - i64 align = type_align_of(e->type); - if (align > 0 && ptr_set_exists(&c->info.minimum_dependency_set, e)) { - add_type_info_type(&c->builtin_ctx, e->type); - } - + (void)type_align_of(e->type); } else if (e->kind == Entity_Procedure) { DeclInfo *decl = e->decl_info; ast_node(pl, ProcLit, decl->proc_lit); @@ -4694,6 +4689,16 @@ void check_parsed_files(Checker *c) { } } } + TIME_SECTION("add type info for type definitions"); + for_array(i, c->info.definitions) { + Entity *e = c->info.definitions[i]; + if (e->kind == Entity_TypeName && e->type != nullptr) { + i64 align = type_align_of(e->type); + if (align > 0 && ptr_set_exists(&c->info.minimum_dependency_set, e)) { + add_type_info_type(&c->builtin_ctx, e->type); + } + } + } TIME_SECTION("check deferred procedures"); for (Entity *src = nullptr; mpmc_dequeue(&c->procs_with_deferred_to_check, &src); /**/) { -- cgit v1.2.3