aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-10-22 17:12:12 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-10-22 17:12:12 -0700
commit01c1f415209f5085e09430cc6df182d7eb2245ee (patch)
tree9f93de2769afd58bf1a88db0b9b266aa24bb4b66 /src/codegen.zig
parentb24e9b6347afc66aa94f61b3ed4c2d02cdb0d0ee (diff)
downloadzig-01c1f415209f5085e09430cc6df182d7eb2245ee.tar.gz
zig-01c1f415209f5085e09430cc6df182d7eb2245ee.zip
stage2: slice and alignment fixes
* Fix backend using wrong union field of the slice instruction. * LLVM backend properly sets alignment on global variables. * Sema: add coercion for *T to *[1]T * Sema: pointers to Decls with explicit alignment now have alignment metadata in them.
Diffstat (limited to 'src/codegen.zig')
-rw-r--r--src/codegen.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/codegen.zig b/src/codegen.zig
index ac9eaeda2a..5f5ee1b549 100644
--- a/src/codegen.zig
+++ b/src/codegen.zig
@@ -1246,7 +1246,8 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
}
fn airSlice(self: *Self, inst: Air.Inst.Index) !void {
- const bin_op = self.air.instructions.items(.data)[inst].bin_op;
+ const ty_pl = self.air.instructions.items(.data)[inst].ty_pl;
+ const bin_op = self.air.extraData(Air.Bin, ty_pl.payload).data;
const result: MCValue = if (self.liveness.isUnused(inst)) .dead else switch (arch) {
else => return self.fail("TODO implement slice for {}", .{self.target.cpu.arch}),
};