aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c.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/codegen/c.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/codegen/c.zig')
-rw-r--r--src/codegen/c.zig23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/codegen/c.zig b/src/codegen/c.zig
index f3ff666802..9514b826ea 100644
--- a/src/codegen/c.zig
+++ b/src/codegen/c.zig
@@ -3343,8 +3343,6 @@ fn genBodyInner(f: *Function, body: []const Air.Inst.Index) error{ AnalysisFail,
.@"try" => try airTry(f, inst),
.try_ptr => try airTryPtr(f, inst),
-
- .expect => try airExpect(f, inst),
.dbg_stmt => try airDbgStmt(f, inst),
.dbg_inline_block => try airDbgInlineBlock(f, inst),
@@ -4706,27 +4704,6 @@ fn airTryPtr(f: *Function, inst: Air.Inst.Index) !CValue {
return lowerTry(f, inst, extra.data.ptr, body, err_union_ty, true);
}
-fn airExpect(f: *Function, inst: Air.Inst.Index) !CValue {
- const bin_op = f.air.instructions.items(.data)[@intFromEnum(inst)].bin_op;
- const operand = try f.resolveInst(bin_op.lhs);
- const expected = try f.resolveInst(bin_op.rhs);
-
- const writer = f.object.writer();
- const local = try f.allocLocal(inst, Type.bool);
- const a = try Assignment.start(f, writer, CType.bool);
- try f.writeCValue(writer, local, .Other);
- try a.assign(f, writer);
-
- try writer.writeAll("zig_expect(");
- try f.writeCValue(writer, operand, .FunctionArgument);
- try writer.writeAll(", ");
- try f.writeCValue(writer, expected, .FunctionArgument);
- try writer.writeAll(")");
-
- try a.end(f, writer);
- return local;
-}
-
fn lowerTry(
f: *Function,
inst: Air.Inst.Index,