c interop type foundation
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user