extern variables and object-like macro consts

This commit is contained in:
2026-06-17 21:52:05 +02:00
parent f5605fd3ec
commit 19e9fbdd4b
33 changed files with 3136 additions and 116 deletions
+4 -1
View File
@@ -644,10 +644,13 @@ lower :: proc(hir_module: ^hir.Module, allocator := context.allocator) -> ir.Mod
_ = ir.global_id(len(module.globals))
append(&module.globals, ir.Global{
name=global.name,
link_name=fmt.aprintf("%s", global.link_name, allocator=allocator),
type=global.type,
is_static=global.is_static,
external=global.external,
writable=global.writable,
static_value=global.static_value,
initializer=nil if global.is_static else lower_global_initializer(hir_module, global, allocator),
initializer=nil if global.is_static || global.external else lower_global_initializer(hir_module, global, allocator),
problematic=global.problematic,
diagnostic=global.diagnostic,
})