| ... | ... | @@ -3719,12 +3719,18 @@ fn store(self: *Self, ptr: MCValue, value: MCValue, ptr_ty: Type, value_ty: Type |
| 3719 | 3719 | .direct => .load_memory_ptr_direct, |
| 3720 | 3720 | }; |
| 3721 | 3721 | const mod = self.bin_file.options.module.?; |
| 3722 | const owner_decl = mod.declPtr(self.mod_fn.owner_decl); |
| 3723 | const atom_index = switch (self.bin_file.tag) { |
| 3724 | .macho => owner_decl.link.macho.sym_index, |
| 3725 | .coff => owner_decl.link.coff.sym_index, |
| 3726 | else => unreachable, // unsupported target format |
| 3727 | }; |
| 3722 | 3728 | _ = try self.addInst(.{ |
| 3723 | 3729 | .tag = tag, |
| 3724 | 3730 | .data = .{ |
| 3725 | 3731 | .payload = try self.addExtra(Mir.LoadMemoryPie{ |
| 3726 | 3732 | .register = @enumToInt(src_reg), |
| 3727 | | .atom_index = mod.declPtr(self.mod_fn.owner_decl).link.macho.sym_index, |
| 3733 | .atom_index = atom_index, |
| 3728 | 3734 | .sym_index = load_struct.sym_index, |
| 3729 | 3735 | }), |
| 3730 | 3736 | }, |
| ... | ... | @@ -5161,12 +5167,18 @@ fn genSetStack(self: *Self, ty: Type, stack_offset: u32, mcv: MCValue) InnerErro |
| 5161 | 5167 | .direct => .load_memory_ptr_direct, |
| 5162 | 5168 | }; |
| 5163 | 5169 | const mod = self.bin_file.options.module.?; |
| 5170 | const owner_decl = mod.declPtr(self.mod_fn.owner_decl); |
| 5171 | const atom_index = switch (self.bin_file.tag) { |
| 5172 | .macho => owner_decl.link.macho.sym_index, |
| 5173 | .coff => owner_decl.link.coff.sym_index, |
| 5174 | else => unreachable, // unsupported target format |
| 5175 | }; |
| 5164 | 5176 | _ = try self.addInst(.{ |
| 5165 | 5177 | .tag = tag, |
| 5166 | 5178 | .data = .{ |
| 5167 | 5179 | .payload = try self.addExtra(Mir.LoadMemoryPie{ |
| 5168 | 5180 | .register = @enumToInt(src_reg), |
| 5169 | | .atom_index = mod.declPtr(self.mod_fn.owner_decl).link.macho.sym_index, |
| 5181 | .atom_index = atom_index, |
| 5170 | 5182 | .sym_index = load_struct.sym_index, |
| 5171 | 5183 | }), |
| 5172 | 5184 | }, |
| ... | ... | @@ -5268,12 +5280,18 @@ fn genSetReg(self: *Self, ty: Type, reg: Register, mcv: MCValue) InnerError!void |
| 5268 | 5280 | .direct => .load_memory_direct, |
| 5269 | 5281 | }; |
| 5270 | 5282 | const mod = self.bin_file.options.module.?; |
| 5283 | const owner_decl = mod.declPtr(self.mod_fn.owner_decl); |
| 5284 | const atom_index = switch (self.bin_file.tag) { |
| 5285 | .macho => owner_decl.link.macho.sym_index, |
| 5286 | .coff => owner_decl.link.coff.sym_index, |
| 5287 | else => unreachable, // unsupported target format |
| 5288 | }; |
| 5271 | 5289 | _ = try self.addInst(.{ |
| 5272 | 5290 | .tag = tag, |
| 5273 | 5291 | .data = .{ |
| 5274 | 5292 | .payload = try self.addExtra(Mir.LoadMemoryPie{ |
| 5275 | 5293 | .register = @enumToInt(reg), |
| 5276 | | .atom_index = mod.declPtr(self.mod_fn.owner_decl).link.macho.sym_index, |
| 5294 | .atom_index = atom_index, |
| 5277 | 5295 | .sym_index = load_struct.sym_index, |
| 5278 | 5296 | }), |
| 5279 | 5297 | }, |
| ... | ... | @@ -5455,12 +5473,18 @@ fn genSetStackArgument(self: *Self, ty: Type, stack_offset: u32, mcv: MCValue) I |
| 5455 | 5473 | .direct => .load_memory_ptr_direct, |
| 5456 | 5474 | }; |
| 5457 | 5475 | const mod = self.bin_file.options.module.?; |
| 5476 | const owner_decl = mod.declPtr(self.mod_fn.owner_decl); |
| 5477 | const atom_index = switch (self.bin_file.tag) { |
| 5478 | .macho => owner_decl.link.macho.sym_index, |
| 5479 | .coff => owner_decl.link.coff.sym_index, |
| 5480 | else => unreachable, // unsupported target format |
| 5481 | }; |
| 5458 | 5482 | _ = try self.addInst(.{ |
| 5459 | 5483 | .tag = tag, |
| 5460 | 5484 | .data = .{ |
| 5461 | 5485 | .payload = try self.addExtra(Mir.LoadMemoryPie{ |
| 5462 | 5486 | .register = @enumToInt(src_reg), |
| 5463 | | .atom_index = mod.declPtr(self.mod_fn.owner_decl).link.macho.sym_index, |
| 5487 | .atom_index = atom_index, |
| 5464 | 5488 | .sym_index = load_struct.sym_index, |
| 5465 | 5489 | }), |
| 5466 | 5490 | }, |