intern identifiers
This commit is contained in:
+2
-4
@@ -1,6 +1,7 @@
|
||||
package ir
|
||||
|
||||
import "../source"
|
||||
import "../symbol"
|
||||
import "../types"
|
||||
import "core:mem"
|
||||
|
||||
@@ -34,7 +35,6 @@ Instruction :: struct {
|
||||
}
|
||||
|
||||
Function :: struct {
|
||||
name: string,
|
||||
link_name: string,
|
||||
c_abi: bool,
|
||||
is_main: bool,
|
||||
@@ -45,7 +45,7 @@ Function :: struct {
|
||||
}
|
||||
|
||||
Global :: struct {
|
||||
name: string,
|
||||
name: symbol.Id,
|
||||
type: types.Type,
|
||||
is_static: bool,
|
||||
static_value: i64,
|
||||
@@ -77,13 +77,11 @@ destroy_instructions :: proc(instructions: []Instruction, allocator: mem.Allocat
|
||||
|
||||
destroy_module :: proc(module: ^Module) {
|
||||
for function in module.functions {
|
||||
delete(function.name, module.allocator)
|
||||
delete(function.link_name, module.allocator)
|
||||
delete(function.param_types, module.allocator)
|
||||
destroy_instructions(function.instructions, module.allocator)
|
||||
}
|
||||
for global in module.globals {
|
||||
delete(global.name, module.allocator)
|
||||
destroy_instructions(global.initializer, module.allocator)
|
||||
}
|
||||
delete(module.functions)
|
||||
|
||||
Reference in New Issue
Block a user