Moved more sem result into file. Still feels weird. Whole thing should just be in the file being passed around directly.

This commit is contained in:
2025-08-18 22:39:45 +02:00
parent 27933e599a
commit 382d790c5b
3 changed files with 48 additions and 23 deletions

View File

@@ -1774,7 +1774,24 @@ check :: (result : *Compile_Result) {
type_check(*checker, file.ast_root);
file.semantic_check_result = checker.result;
file.constant_buffers = array_copy(*checker.result.constant_buffers);
//@Incomplete: should just be a copy?
file.scope_stack.stack.allocator = file.allocator;
array_reserve(*file.scope_stack.stack, checker.result.scope_stack.stack.count);
for scope : checker.result.scope_stack.stack {
array_add(*file.scope_stack.stack, scope);
}
file.type_variables.allocator = file.allocator;
array_reserve(*file.type_variables, checker.result.type_variables.count);
for tv : checker.result.type_variables {
array_add(*file.type_variables, tv);
}
file.vertex_entry_point.node = checker.result.vertex_entry_point;
file.pixel_entry_point.node = checker.result.pixel_entry_point;
result.had_error |= checker.result.had_error;
copy_messages(checker.result.messages, *result.messages);
}
@@ -2084,8 +2101,7 @@ pretty_print_symbol_table :: (result : *Compile_Result, allocator : Allocator) -
for *file : result.files {
current_scope := cast(Scope_Handle)1;
check_result := file.semantic_check_result;
pretty_print_scope(current_scope, check_result.scope_stack, check_result.type_variables, *check_result.scope_stack.stack[0], *builder);
pretty_print_scope(current_scope, file.scope_stack, file.type_variables, *file.scope_stack.stack[0], *builder);
}