diff options
| author | gingerBill <bill@gingerbill.org> | 2021-11-05 12:11:33 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-11-05 12:11:33 +0000 |
| commit | a022f18015596d02c15e76eef582cd39c4c02fe6 (patch) | |
| tree | e84d15cef190d8452efc36729670ec6dd3ca7d5e /src/checker.cpp | |
| parent | adb5928767b641132dd34ce44616877f635e71bb (diff) | |
Reorganize code
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 1a92b1c06..125893d11 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -5207,6 +5207,17 @@ void check_sort_init_procedures(Checker *c) { gb_sort_array(c->info.init_procedures.data, c->info.init_procedures.count, init_procedures_cmp); } +void add_type_info_for_type_definitions(Checker *c) { + 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); + } + } + } +} void check_parsed_files(Checker *c) { TIME_SECTION("map full filepaths to scope"); @@ -5286,7 +5297,7 @@ void check_parsed_files(Checker *c) { } - TIME_SECTION("add type information"); + TIME_SECTION("add basic type information"); // Add "Basic" type information for (isize i = 0; i < Basic_COUNT; i++) { Type *t = &basic_types[i]; @@ -5331,16 +5342,7 @@ void check_parsed_files(Checker *c) { check_unchecked_bodies(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); - } - } - } - + add_type_info_for_type_definitions(c); check_merge_queues_into_arrays(c); TIME_SECTION("check entry point"); |