diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-12-15 20:28:51 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-01-01 17:51:20 -0700 |
| commit | 48d5861f9256dfd1c5357dd6f2a023e700de16e4 (patch) | |
| tree | 72534a37dff36062ba16fc86be90997d3f16ef22 /src/arch/x86_64/CodeGen.zig | |
| parent | 638db680f4c6380bb193da520f29a7c587bfb719 (diff) | |
| download | zig-48d5861f9256dfd1c5357dd6f2a023e700de16e4.tar.gz zig-48d5861f9256dfd1c5357dd6f2a023e700de16e4.zip | |
fix more compilation errors introduced by this branch
Diffstat (limited to 'src/arch/x86_64/CodeGen.zig')
| -rw-r--r-- | src/arch/x86_64/CodeGen.zig | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig index 5056bc32fd..dbb87fa566 100644 --- a/src/arch/x86_64/CodeGen.zig +++ b/src/arch/x86_64/CodeGen.zig @@ -25,7 +25,9 @@ const Emit = @import("Emit.zig"); const Liveness = @import("../../Liveness.zig"); const Lower = @import("Lower.zig"); const Mir = @import("Mir.zig"); +const Package = @import("../../Package.zig"); const Module = @import("../../Module.zig"); +const Zcu = Module; const InternPool = @import("../../InternPool.zig"); const Alignment = InternPool.Alignment; const Target = std.Target; @@ -56,6 +58,7 @@ bin_file: *link.File, debug_output: DebugInfoOutput, target: *const std.Target, owner: Owner, +mod: *Package.Module, err_msg: ?*ErrorMsg, args: []MCValue, va_info: union { @@ -10906,7 +10909,7 @@ fn genCall(self: *Self, info: union(enum) { if (self.bin_file.cast(link.File.Elf)) |elf_file| { const sym_index = try elf_file.zigObjectPtr().?.getOrCreateMetadataForDecl(elf_file, func.owner_decl); const sym = elf_file.symbol(sym_index); - if (self.bin_file.options.pic) { + if (self.mod.pic) { const callee_reg: Register = switch (resolved_cc) { .SysV => callee: { if (!fn_info.is_var_args) break :callee .rax; @@ -13819,7 +13822,7 @@ fn genLazySymbolRef( const sym_index = elf_file.zigObjectPtr().?.getOrCreateMetadataForLazySymbol(elf_file, lazy_sym) catch |err| return self.fail("{s} creating lazy symbol", .{@errorName(err)}); const sym = elf_file.symbol(sym_index); - if (self.bin_file.options.pic) { + if (self.mod.pic) { switch (tag) { .lea, .call => try self.genSetReg(reg, Type.usize, .{ .load_symbol = .{ .sym = sym.esym_index }, @@ -16062,7 +16065,7 @@ fn resolveInst(self: *Self, ref: Air.Inst.Ref) InnerError!MCValue { const const_mcv = try self.genTypedValue(.{ .ty = ty, .val = Value.fromInterned(ip_index) }); switch (const_mcv) { .lea_tlv => |tlv_sym| if (self.bin_file.cast(link.File.Elf)) |_| { - if (self.bin_file.options.pic) { + if (self.mod.pic) { try self.spillRegisters(&.{ .rdi, .rax }); } else { try self.spillRegisters(&.{.rax}); |
