intern identifiers
This commit is contained in:
@@ -7,6 +7,7 @@ import "./loader"
|
||||
import "./lower"
|
||||
import "./opt"
|
||||
import "./source"
|
||||
import "./symbol"
|
||||
import "core:fmt"
|
||||
import vmem "core:mem/virtual"
|
||||
import "core:os"
|
||||
@@ -17,6 +18,8 @@ compile_package :: proc(input_path, output_path: string) -> int {
|
||||
defer source.destroy_store(&sources)
|
||||
diagnostics := source.init_store_diagnostics(&sources)
|
||||
defer source.destroy_diagnostics(&diagnostics)
|
||||
symbols := symbol.init_table()
|
||||
defer symbol.destroy_table(&symbols)
|
||||
|
||||
lexer_arena: vmem.Arena
|
||||
if err := vmem.arena_init_growing(&lexer_arena); err != nil {
|
||||
@@ -47,6 +50,7 @@ compile_package :: proc(input_path, output_path: string) -> int {
|
||||
input_path,
|
||||
&sources,
|
||||
&diagnostics,
|
||||
&symbols,
|
||||
vmem.arena_allocator(&lexer_arena),
|
||||
vmem.arena_allocator(&parser_arena),
|
||||
)
|
||||
@@ -55,13 +59,13 @@ compile_package :: proc(input_path, output_path: string) -> int {
|
||||
return 2
|
||||
}
|
||||
vmem.arena_free_all(&lexer_arena)
|
||||
hir_module := checker.check(&ast_module, &diagnostics, vmem.arena_allocator(&checker_arena))
|
||||
hir_module := checker.check(&ast_module, &diagnostics, &symbols, 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)
|
||||
opt.run(&ir_module)
|
||||
|
||||
llvm_text := llvm.emit(&ir_module, &diagnostics)
|
||||
llvm_text := llvm.emit(&ir_module, &diagnostics, &symbols)
|
||||
defer delete(llvm_text)
|
||||
vmem.arena_free_all(&lower_arena)
|
||||
llvm_path := fmt.tprintf("%s.brolang-%d.ll", output_path, os2.get_pid())
|
||||
|
||||
Reference in New Issue
Block a user