restricted c header imports

This commit is contained in:
2026-06-14 14:42:38 +02:00
parent 4e860b033e
commit 638ca57f5c
24 changed files with 1377 additions and 45 deletions
+5 -1
View File
@@ -1,6 +1,7 @@
package compiler
import "./backend"
import "./cimport"
import "./checker"
import "./llvm"
import "./linker"
@@ -19,6 +20,7 @@ compile_package :: proc(
input_path, output_path: string,
link_arguments: []linker.Argument = nil,
selected := target.DEFAULT,
c_options := cimport.Options{},
) -> int {
sources := source.init_store()
defer source.destroy_store(&sources)
@@ -59,6 +61,8 @@ compile_package :: proc(
&symbols,
vmem.arena_allocator(&lexer_arena),
vmem.arena_allocator(&parser_arena),
c_options,
selected,
)
if !loaded {
source.print_all(&diagnostics)
@@ -83,7 +87,7 @@ compile_package :: proc(
}
source.print_all(&diagnostics)
if !backend.compile(llvm_path, output_path, link_arguments, selected) {
if !backend.compile(llvm_path, output_path, link_arguments, selected, c_options) {
return 2
}
if len(diagnostics.items) > 0 {