diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-12-11 12:24:15 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-12-11 12:24:15 -0700 |
| commit | 3d23ba9c352b93a299d17e85d9a758cfac613d23 (patch) | |
| tree | adbfde693ae4952daabce2aea03a3c6216acc846 /src/Sema.zig | |
| parent | f88b523065fbb8afbd723fd6e803ace0334b713c (diff) | |
| download | zig-3d23ba9c352b93a299d17e85d9a758cfac613d23.tar.gz zig-3d23ba9c352b93a299d17e85d9a758cfac613d23.zip | |
Revert "Sema: forbid @breakpoint from being called at comptime"
This reverts commit f88b523065fbb8afbd723fd6e803ace0334b713c.
Let's please go through the language proposal process for this change. I
don't see any justification for this breaking change even in the commit
message.
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 160a531d92..752a5b1023 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -1292,7 +1292,9 @@ fn analyzeBodyInner( continue; }, .breakpoint => { - try sema.zirBreakpoint(block, extended); + if (!block.is_comptime) { + _ = try block.addNoOp(.breakpoint); + } i += 1; continue; }, @@ -5618,13 +5620,6 @@ fn zirTrap(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Zir.In return always_noreturn; } -fn zirBreakpoint(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData) CompileError!void { - const src = LazySrcLoc.nodeOffset(@bitCast(extended.operand)); - if (block.is_comptime) - return sema.fail(block, src, "encountered @breakpoint at comptime", .{}); - _ = try block.addNoOp(.breakpoint); -} - fn zirLoop(sema: *Sema, parent_block: *Block, inst: Zir.Inst.Index) CompileError!Air.Inst.Ref { const tracy = trace(@src()); defer tracy.end(); |
