aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-05-22 09:57:43 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-05-22 09:57:43 -0700
commit9be8a9000faead40b1aec4877506ff10b066659c (patch)
tree6dd2ebc0520ed61c8221e04a01b4b2f715f5520c /src/Sema.zig
parenta7de02e05216db9a04e438703ddf1b6b12f3fbef (diff)
downloadzig-9be8a9000faead40b1aec4877506ff10b066659c.tar.gz
zig-9be8a9000faead40b1aec4877506ff10b066659c.zip
Revert "implement `@expect` builtin (#19658)"
This reverts commit a7de02e05216db9a04e438703ddf1b6b12f3fbef. This did not implement the accepted proposal, and I did not sign off on the changes. I would like a chance to review this, please.
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index fcf82b1153..ca6d562eef 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -1258,7 +1258,6 @@ fn analyzeBodyInner(
.work_group_size => try sema.zirWorkItem( block, extended, extended.opcode),
.work_group_id => try sema.zirWorkItem( block, extended, extended.opcode),
.in_comptime => try sema.zirInComptime( block),
- .expect => try sema.zirExpect( block, extended),
.closure_get => try sema.zirClosureGet( block, extended),
// zig fmt: on
@@ -17554,34 +17553,6 @@ fn zirThis(
return sema.analyzeDeclVal(block, src, this_decl_index);
}
-fn zirExpect(sema: *Sema, block: *Block, inst: Zir.Inst.Extended.InstData) CompileError!Air.Inst.Ref {
- const bin_op = sema.code.extraData(Zir.Inst.BinNode, inst.operand).data;
- const operand = try sema.resolveInst(bin_op.lhs);
- const expected = try sema.resolveInst(bin_op.rhs);
-
- const expected_src = LazySrcLoc{ .node_offset_builtin_call_arg1 = bin_op.node };
-
- if (!try sema.isComptimeKnown(expected)) {
- return sema.fail(block, expected_src, "@expect 'expected' must be comptime-known", .{});
- }
-
- if (try sema.resolveValue(operand)) |op| {
- return Air.internedToRef(op.toIntern());
- }
-
- if (sema.mod.backendSupportsFeature(.can_expect) and sema.mod.optimizeMode() != .Debug) {
- return try block.addInst(.{
- .tag = .expect,
- .data = .{ .bin_op = .{
- .lhs = operand,
- .rhs = expected,
- } },
- });
- } else {
- return operand;
- }
-}
-
fn zirClosureGet(sema: *Sema, block: *Block, extended: Zir.Inst.Extended.InstData) CompileError!Air.Inst.Ref {
const mod = sema.mod;
const ip = &mod.intern_pool;