mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-12 14:23:33 +00:00
Minor change from make_checker_context to init_checker_context
This commit is contained in:
@@ -1530,17 +1530,16 @@ gb_internal void destroy_checker_info(CheckerInfo *i) {
|
||||
map_destroy(&i->load_directory_map);
|
||||
}
|
||||
|
||||
gb_internal CheckerContext make_checker_context(Checker *c) {
|
||||
CheckerContext ctx = {};
|
||||
ctx.checker = c;
|
||||
ctx.info = &c->info;
|
||||
ctx.scope = builtin_pkg->scope;
|
||||
ctx.pkg = builtin_pkg;
|
||||
gb_internal void init_checker_context(CheckerContext *ctx, Checker *c) {
|
||||
ctx->checker = c;
|
||||
ctx->info = &c->info;
|
||||
ctx->scope = builtin_pkg->scope;
|
||||
ctx->pkg = builtin_pkg;
|
||||
|
||||
ctx.type_path = new_checker_type_path(heap_allocator());
|
||||
ctx.type_level = 0;
|
||||
return ctx;
|
||||
ctx->type_path = new_checker_type_path(heap_allocator());
|
||||
ctx->type_level = 0;
|
||||
}
|
||||
|
||||
gb_internal void destroy_checker_context(CheckerContext *ctx) {
|
||||
destroy_checker_type_path(ctx->type_path, heap_allocator());
|
||||
}
|
||||
@@ -1605,7 +1604,7 @@ gb_internal void init_checker(Checker *c) {
|
||||
mpsc_init(&c->global_untyped_queue, a); // , 1<<20);
|
||||
mpsc_init(&c->soa_types_to_complete, a); // , 1<<20);
|
||||
|
||||
c->builtin_ctx = make_checker_context(c);
|
||||
init_checker_context(&c->builtin_ctx, c);
|
||||
}
|
||||
|
||||
gb_internal void destroy_checker(Checker *c) {
|
||||
@@ -4964,7 +4963,7 @@ gb_internal void check_collect_entities(CheckerContext *c, Slice<Ast *> const &n
|
||||
|
||||
gb_internal CheckerContext *create_checker_context(Checker *c) {
|
||||
CheckerContext *ctx = gb_alloc_item(permanent_allocator(), CheckerContext);
|
||||
*ctx = make_checker_context(c);
|
||||
init_checker_context(ctx, c);
|
||||
return ctx;
|
||||
}
|
||||
|
||||
@@ -5409,7 +5408,8 @@ gb_internal DECL_ATTRIBUTE_PROC(foreign_import_decl_attribute) {
|
||||
}
|
||||
|
||||
gb_internal void check_foreign_import_fullpaths(Checker *c) {
|
||||
CheckerContext ctx = make_checker_context(c);
|
||||
CheckerContext ctx = {};
|
||||
init_checker_context(&ctx, c);
|
||||
|
||||
UntypedExprInfoMap untyped = {};
|
||||
defer (map_destroy(&untyped));
|
||||
@@ -5792,7 +5792,7 @@ gb_internal void check_collect_entities_all(Checker *c) {
|
||||
for (isize i = 0; i < thread_count; i++) {
|
||||
auto *wd = &collect_entity_worker_data[i];
|
||||
wd->c = c;
|
||||
wd->ctx = make_checker_context(c);
|
||||
init_checker_context(&wd->ctx, c);
|
||||
map_init(&wd->untyped);
|
||||
}
|
||||
|
||||
@@ -5833,7 +5833,7 @@ gb_internal void check_export_entities(Checker *c) {
|
||||
for (isize i = 0; i < thread_count; i++) {
|
||||
auto *wd = &collect_entity_worker_data[i];
|
||||
map_clear(&wd->untyped);
|
||||
wd->ctx = make_checker_context(c);
|
||||
init_checker_context(&wd->ctx, c);
|
||||
}
|
||||
|
||||
for (auto const &entry : c->info.packages) {
|
||||
@@ -5900,7 +5900,8 @@ gb_internal void check_import_entities(Checker *c) {
|
||||
}
|
||||
|
||||
TIME_SECTION("check_import_entities - collect file decls");
|
||||
CheckerContext ctx = make_checker_context(c);
|
||||
CheckerContext ctx = {};
|
||||
init_checker_context(&ctx, c);
|
||||
|
||||
UntypedExprInfoMap untyped = {};
|
||||
defer (map_destroy(&untyped));
|
||||
@@ -6249,7 +6250,8 @@ gb_internal bool check_proc_info(Checker *c, ProcInfo *pi, UntypedExprInfoMap *u
|
||||
}
|
||||
}
|
||||
|
||||
CheckerContext ctx = make_checker_context(c);
|
||||
CheckerContext ctx = {};
|
||||
init_checker_context(&ctx, c);
|
||||
defer (destroy_checker_context(&ctx));
|
||||
reset_checker_context(&ctx, pi->file, untyped);
|
||||
ctx.decl = pi->decl;
|
||||
|
||||
Reference in New Issue
Block a user