fn emitDbgStmtForceCurrentIndex(gz: *GenZir, lc: LineColumn) !void gz: *GenZirlc: LineColumn13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306fn emitDbgStmtForceCurrentIndex(gz: *GenZir, lc: LineColumn) !void {
const astgen = gz.astgen;
if (gz.instructions.items.len > gz.instructions_top and
@backingInt(gz.instructions.items[gz.instructions.items.len - 1]) == astgen.instructions.len - 1)
{
const last = astgen.instructions.len - 1;
if (astgen.instructions.items(.tag)[last] == .dbg_stmt) {
astgen.instructions.items(.data)[last].dbg_stmt = .{
.line = lc[0],
.column = lc[1],
};
return;
}
}
_ = try gz.add(.{ .tag = .dbg_stmt, .data = .{
.dbg_stmt = .{
.line = lc[0],
.column = lc[1],
},
} });
}
In some cases, Sema expects us to generate a
dbg_stmtat the instruction index directly preceding the next instruction (e.g. if a call is %10, it expects a dbg_stmt at %9). TODO: this logic may allow redundant dbg_stmt instructions; fix up Sema so we don't need it!