aboutsummaryrefslogtreecommitdiff
path: root/src/Sema.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-10-22 15:12:22 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-10-22 15:35:35 -0700
commit069c83d58cebba88275ee76ba01fabcd8e964573 (patch)
treeab7e52f307bd23869e2461189383522dc64f42de /src/Sema.zig
parent86b92809635607ff357ce96902e2aaf83c3fd029 (diff)
downloadzig-069c83d58cebba88275ee76ba01fabcd8e964573.tar.gz
zig-069c83d58cebba88275ee76ba01fabcd8e964573.zip
stage2: change `@bitCast` to always be by-value
After a discussion about language specs, this seems like the best way to go, because it's simpler to reason about both for humans and compilers. The `bitcast_result_ptr` ZIR instruction is no longer needed. This commit also implements writing enums, arrays, and vectors to virtual memory at compile-time. This unlocked some more of compiler-rt being able to build, which in turn unlocks saturating arithmetic behavior tests. There was also a memory leak in the comptime closure system which is now fixed.
Diffstat (limited to 'src/Sema.zig')
-rw-r--r--src/Sema.zig7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/Sema.zig b/src/Sema.zig
index 1826d03559..166b668731 100644
--- a/src/Sema.zig
+++ b/src/Sema.zig
@@ -513,7 +513,6 @@ pub fn analyzeBody(
.bit_not => try sema.zirBitNot(block, inst),
.bit_or => try sema.zirBitwise(block, inst, .bit_or),
.bitcast => try sema.zirBitcast(block, inst),
- .bitcast_result_ptr => try sema.zirBitcastResultPtr(block, inst),
.suspend_block => try sema.zirSuspendBlock(block, inst),
.bool_not => try sema.zirBoolNot(block, inst),
.bool_br_and => try sema.zirBoolBr(block, inst, false),
@@ -1385,12 +1384,6 @@ pub fn resolveInstValue(
};
}
-fn zirBitcastResultPtr(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.Inst.Ref {
- const inst_data = sema.code.instructions.items(.data)[inst].pl_node;
- const src = inst_data.src();
- return sema.fail(block, src, "TODO implement zir_sema.zirBitcastResultPtr", .{});
-}
-
fn zirCoerceResultPtr(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.Inst.Ref {
const tracy = trace(@src());
defer tracy.end();