aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-07-13 17:24:20 +0100
committergingerBill <bill@gingerbill.org>2021-07-13 17:24:20 +0100
commit4ded42a33b2427e2d8b850422f4e1c1798ce4df1 (patch)
tree34df7ac5d4d0d7f1b533d93c9b4d2976647fd244 /src/checker.cpp
parent1877965ac37407200b2d8f67f1c2ae474d1e7cbb (diff)
Split up cycle check and adding type info timings
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp17
1 files changed, 11 insertions, 6 deletions
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); /**/) {