authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-02-23 01:44:34+01:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2024-02-23 01:45:25+01:00
logc894df54f75f8004348834fce21df1f0684536cc
tree5114bf94faaaa63fff982ee96c940889da809bb9
parentdbfa3238fefee0c802fceb39c8605a0b21659bd3

Builder: fix debug location of the first instruction in a block


1 files changed, 3 insertions(+), 1 deletions(-)

src/codegen/llvm/Builder.zig+3-1
...@@ -6481,7 +6481,9 @@ pub const WipFunction = struct {...@@ -6481,7 +6481,9 @@ pub const WipFunction = struct {
6481 self.instructions.appendAssumeCapacity(instruction);6481 self.instructions.appendAssumeCapacity(instruction);
6482 if (!self.builder.strip) {6482 if (!self.builder.strip) {
6483 self.names.appendAssumeCapacity(final_name);6483 self.names.appendAssumeCapacity(final_name);
6484 if (!std.meta.eql(self.current_debug_location, self.last_debug_location)) {6484 if (block_instructions.items.len == 0 or
6485 self.current_debug_location != self.last_debug_location)
6486 {
6485 self.debug_locations.putAssumeCapacity(index, self.current_debug_location);6487 self.debug_locations.putAssumeCapacity(index, self.current_debug_location);
6486 self.last_debug_location = self.current_debug_location;6488 self.last_debug_location = self.current_debug_location;
6487 }6489 }