aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-12-30 19:57:11 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-12-30 21:41:02 -0800
commit133da8692e80532797dd91b32539cf2175280a95 (patch)
tree8ff37b28c783d14be6aa459673202909de47b1ec /src/codegen.zig
parent2622575fde2b5d70926fe62ed272412d72eef7b0 (diff)
downloadzig-133da8692e80532797dd91b32539cf2175280a95.tar.gz
zig-133da8692e80532797dd91b32539cf2175280a95.zip
stage2: rework Type Payload layout
Add `Type.castTag` and note that it is preferable to call than `Type.cast`. This matches other abstractions in the codebase. Added a convenience function `Type.Tag.create` which really cleans up the callsites of creating `Type` objects. `Type` payloads can now share types. This is in preparation for another improvement that I want to do.
Diffstat (limited to 'src/codegen.zig')
-rw-r--r--src/codegen.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/codegen.zig b/src/codegen.zig
index 01deb13c0e..d98a87a440 100644
--- a/src/codegen.zig
+++ b/src/codegen.zig
@@ -3262,7 +3262,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
if (typed_value.val.isNull())
return MCValue{ .immediate = 0 };
- var buf: Type.Payload.PointerSimple = undefined;
+ var buf: Type.Payload.ElemType = undefined;
return self.genTypedValue(src, .{
.ty = typed_value.ty.optionalChild(&buf),
.val = typed_value.val,