wasm shell + destructuring

This commit is contained in:
agra
2026-03-03 13:21:54 +02:00
parent 6c5672c7df
commit 004aff5f67
18 changed files with 219 additions and 32 deletions

View File

@@ -728,6 +728,14 @@ pub const LLVMEmitter = struct {
const llvm_ty = self.toLLVMType(instruction.ty);
self.mapRef(c.LLVMBuildLoad2(self.builder, llvm_ty, llvm_global, "gload"));
},
.global_addr => |gid| {
const llvm_global = self.global_map.get(gid.index()) orelse {
self.mapRef(c.LLVMGetUndef(self.cached_ptr));
return;
};
// Return the global's address directly (no load)
self.mapRef(llvm_global);
},
.func_ref => |fid| {
// Produce a reference to the function as a function pointer value
if (self.func_map.get(@intFromEnum(fid))) |llvm_func| {