mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Multithread "check all scope usages"
This commit is contained in:
@@ -1163,8 +1163,8 @@ gb_internal String internal_odin_root_dir(void) {
|
|||||||
return global_module_path;
|
return global_module_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEMPORARY_ALLOCATOR_GUARD();
|
||||||
auto path_buf = array_make<char>(temporary_allocator(), 300);
|
auto path_buf = array_make<char>(temporary_allocator(), 300);
|
||||||
defer (array_free(&path_buf));
|
|
||||||
|
|
||||||
len = 0;
|
len = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
|||||||
+33
-10
@@ -7204,6 +7204,36 @@ gb_internal void check_update_dependency_tree_for_procedures(Checker *c) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
gb_internal WORKER_TASK_PROC(check_scope_usage_file_worker) {
|
||||||
|
Checker *c = global_checker_ptr.load(std::memory_order_relaxed);
|
||||||
|
AstFile *f = cast(AstFile *)data;
|
||||||
|
u64 vet_flags = ast_file_vet_flags(f);
|
||||||
|
check_scope_usage(c, f->scope, vet_flags);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
gb_internal WORKER_TASK_PROC(check_scope_usage_pkg_worker) {
|
||||||
|
Checker *c = global_checker_ptr.load(std::memory_order_relaxed);
|
||||||
|
AstPackage *pkg = cast(AstPackage *)data;
|
||||||
|
check_scope_usage_internal(c, pkg->scope, 0, true);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
gb_internal void check_all_scope_usages(Checker *c) {
|
||||||
|
for (auto const &entry : c->info.files) {
|
||||||
|
AstFile *f = entry.value;
|
||||||
|
thread_pool_add_task(check_scope_usage_file_worker, f);
|
||||||
|
}
|
||||||
|
for (auto const &entry : c->info.packages) {
|
||||||
|
AstPackage *pkg = entry.value;
|
||||||
|
thread_pool_add_task(check_scope_usage_pkg_worker, pkg);
|
||||||
|
}
|
||||||
|
|
||||||
|
thread_pool_wait();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
gb_internal void check_parsed_files(Checker *c) {
|
gb_internal void check_parsed_files(Checker *c) {
|
||||||
global_checker_ptr.store(c, std::memory_order_relaxed);
|
global_checker_ptr.store(c, std::memory_order_relaxed);
|
||||||
@@ -7271,16 +7301,9 @@ gb_internal void check_parsed_files(Checker *c) {
|
|||||||
TIME_SECTION("add entities from procedure bodies");
|
TIME_SECTION("add entities from procedure bodies");
|
||||||
check_merge_queues_into_arrays(c);
|
check_merge_queues_into_arrays(c);
|
||||||
|
|
||||||
TIME_SECTION("check scope usage");
|
TIME_SECTION("check all scope usages");
|
||||||
for (auto const &entry : c->info.files) {
|
check_all_scope_usages(c);
|
||||||
AstFile *f = entry.value;
|
|
||||||
u64 vet_flags = ast_file_vet_flags(f);
|
|
||||||
check_scope_usage(c, f->scope, vet_flags);
|
|
||||||
}
|
|
||||||
for (auto const &entry : c->info.packages) {
|
|
||||||
AstPackage *pkg = entry.value;
|
|
||||||
check_scope_usage_internal(c, pkg->scope, 0, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
TIME_SECTION("add basic type information");
|
TIME_SECTION("add basic type information");
|
||||||
// Add "Basic" type information
|
// Add "Basic" type information
|
||||||
|
|||||||
Reference in New Issue
Block a user