diff options
| author | Baitinq <[email protected]> | 2025-03-08 18:50:50 +0100 |
|---|---|---|
| committer | Baitinq <[email protected]> | 2025-03-08 18:50:50 +0100 |
| commit | ee724245d24bd018451b268cce2f162b8064657d (patch) | |
| tree | 3a3380ca67ec7233d6897c05c92f56edfc58ef52 | |
| parent | Misc: Remove comments (diff) | |
| download | interpreter-ee724245d24bd018451b268cce2f162b8064657d.tar.gz interpreter-ee724245d24bd018451b268cce2f162b8064657d.tar.bz2 interpreter-ee724245d24bd018451b268cce2f162b8064657d.zip | |
Codegen: Use alternative way of knowing if we should load function before call
| -rw-r--r-- | src/codegen.zig | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/codegen.zig b/src/codegen.zig index 9256776..c780713 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -158,9 +158,7 @@ pub const CodeGen = struct { .PRIMARY_EXPRESSION => |primary_expression| { std.debug.assert(primary_expression == .IDENTIFIER); function = self.environment.get_variable(primary_expression.IDENTIFIER.name) orelse return CodeGenError.CompilationError; - std.debug.print("STACK LVEL: {any} {s}\n", .{ function.stack_level.?, primary_expression.IDENTIFIER.name }); - if (function.stack_level.? > 0) { - std.debug.print("NOT GLOBAL FN! {s} {any}\n", .{ primary_expression.IDENTIFIER.name, function.stack_level }); + if (core.LLVMGetValueKind(function.value) != types.LLVMValueKind.LLVMFunctionValueKind) { function.value = core.LLVMBuildLoad2(self.builder, core.LLVMPointerType(function.type, 0), function.value, ""); } }, |