mirror of
https://github.com/odin-lang/Odin.git
synced 2026-10-08 22:01:47 -04:00
Group the per-thread error state into ErrorContext
This commit is contained in:
1 parent
86502ed7ec
commit
e702482f38
5 files changed
+102
-103
No files matched your search
+4
-4
@@ -860,7 +860,7 @@ gb_internal bool find_or_generate_polymorphic_procedure(CheckerContext *old_c, E
|
||||
proc_info->tags = tags;
|
||||
proc_info->generated_from_polymorphic = true;
|
||||
proc_info->poly_def_node = poly_def_node;
|
||||
proc_info->poly_parent = global_error_instantiation;
|
||||
proc_info->poly_parent = global_error_context.instantiations.proc;
|
||||
|
||||
// Before it can be found by another thread which could use it first
|
||||
d->gen_proc_info.store(proc_info);
|
||||
@@ -9173,8 +9173,8 @@ gb_internal CallArgumentError check_polymorphic_record_type(CheckerContext *c, O
|
||||
String generated_name = make_string_c(expr_to_string(call));
|
||||
|
||||
Type *named_type = alloc_type_named(generated_name, nullptr, nullptr);
|
||||
ErrorRecordInstantiation instantiation = {global_error_record_instantiation, call, named_type};
|
||||
global_error_record_instantiation = &instantiation;
|
||||
ErrorRecordInstantiation instantiation = {global_error_context.instantiations.records, call, named_type};
|
||||
global_error_context.instantiations.records = &instantiation;
|
||||
if (bt->kind == Type_Struct) {
|
||||
Ast *node = clone_ast(bt->Struct.node);
|
||||
Type *struct_type = alloc_type_struct();
|
||||
@@ -9202,7 +9202,7 @@ gb_internal CallArgumentError check_polymorphic_record_type(CheckerContext *c, O
|
||||
} else {
|
||||
GB_PANIC("Unsupported parametric polymorphic record type");
|
||||
}
|
||||
global_error_record_instantiation = instantiation.prev;
|
||||
global_error_context.instantiations.records = instantiation.prev;
|
||||
|
||||
add_declaration_dependency(c, named_type->Named.type_name);
|
||||
operand->mode = Addressing_Type;
|
||||
|
||||
Reference in new issue
Block a user