c interop type foundation

This commit is contained in:
2026-06-12 18:10:52 +02:00
parent d2f0d16795
commit 4e860b033e
27 changed files with 3523 additions and 380 deletions
+8 -3
View File
@@ -9,12 +9,17 @@ import "./lower"
import "./opt"
import "./source"
import "./symbol"
import "./target"
import "core:fmt"
import vmem "core:mem/virtual"
import "core:os"
import "core:os/os2"
compile_package :: proc(input_path, output_path: string, link_arguments: []linker.Argument = nil) -> int {
compile_package :: proc(
input_path, output_path: string,
link_arguments: []linker.Argument = nil,
selected := target.DEFAULT,
) -> int {
sources := source.init_store()
defer source.destroy_store(&sources)
diagnostics := source.init_store_diagnostics(&sources)
@@ -61,7 +66,7 @@ compile_package :: proc(input_path, output_path: string, link_arguments: []linke
return 2
}
vmem.arena_free_all(&lexer_arena)
hir_module := checker.check(&ast_module, &diagnostics, &symbols, vmem.arena_allocator(&checker_arena))
hir_module := checker.check(&ast_module, &diagnostics, &symbols, selected, vmem.arena_allocator(&checker_arena))
vmem.arena_free_all(&parser_arena)
ir_module := lower.lower(&hir_module, vmem.arena_allocator(&lower_arena))
vmem.arena_free_all(&checker_arena)
@@ -78,7 +83,7 @@ compile_package :: proc(input_path, output_path: string, link_arguments: []linke
}
source.print_all(&diagnostics)
if !backend.compile(llvm_path, output_path, link_arguments) {
if !backend.compile(llvm_path, output_path, link_arguments, selected) {
return 2
}
if len(diagnostics.items) > 0 {