aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-08-27 11:18:38 +0100
committergingerBill <bill@gingerbill.org>2021-08-27 11:18:38 +0100
commit582559f7ac54b62cbdccf6f396f072b15a950664 (patch)
tree987c4d69ebf5aa2e8d5be414f49666fbbfa42daa /src/checker.cpp
parent53556d9bd261272137256af9a5716dc26453337b (diff)
Correct did you mean logic and make thread-safe-er
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index e3af570f8..5544ef58e 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -656,7 +656,16 @@ AstPackage *get_core_package(CheckerInfo *info, String name) {
String path = get_fullpath_core(a, name);
defer (gb_free(a, path.text));
auto found = string_map_get(&info->packages, path);
- GB_ASSERT_MSG(found != nullptr, "Missing core package %.*s", LIT(name));
+ if (found == nullptr) {
+ gb_printf_err("Name: %.*s\n", LIT(name));
+ gb_printf_err("Fullpath: %.*s\n", LIT(path));
+
+ for_array(i, info->packages.entries) {
+ auto *entry = &info->packages.entries[i];
+ gb_printf_err("%.*s\n", LIT(entry->key.string));
+ }
+ GB_ASSERT_MSG(found != nullptr, "Missing core package %.*s", LIT(name));
+ }
return *found;
}
@@ -4578,9 +4587,11 @@ bool check_proc_info(Checker *c, ProcInfo *pi, UntypedExprInfoMap *untyped, Proc
ctx.decl = pi->decl;
ctx.procs_to_check_queue = procs_to_check_queue;
GB_ASSERT(procs_to_check_queue != nullptr);
-
+
+ GB_ASSERT(pi->type->kind == Type_Proc);
TypeProc *pt = &pi->type->Proc;
String name = pi->token.string;
+
if (pt->is_polymorphic && !pt->is_poly_specialized) {
Token token = pi->token;
if (pi->poly_def_node != nullptr) {
@@ -4658,7 +4669,8 @@ void check_unchecked_bodies(Checker *c) {
if (pi->body == nullptr) {
continue;
}
-
+
+ debugf("unchecked: %.*s\n", LIT(e->token.string));
mpmc_enqueue(&c->procs_to_check_queue, pi);
}
}
@@ -4762,6 +4774,7 @@ void check_procedure_bodies(Checker *c) {
if (!build_context.threaded_checker) {
worker_count = 0;
}
+ worker_count = 0;
if (worker_count == 0) {
auto *this_queue = &c->procs_to_check_queue;