aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86_64/CodeGen.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-05-07 15:38:31 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-06-10 20:42:29 -0700
commit4d88f825bc5eb14aa00446f046ab4714a4fdce70 (patch)
tree4729946dff1e6ae200426418f4f6653003468d4f /src/arch/x86_64/CodeGen.zig
parenta5fb16959423005de999fb541d5d5e9aebb8e09e (diff)
downloadzig-4d88f825bc5eb14aa00446f046ab4714a4fdce70.tar.gz
zig-4d88f825bc5eb14aa00446f046ab4714a4fdce70.zip
stage2: implement intTagType logic
This commit changes a lot of `*const Module` to `*Module` to make it work, since accessing the integer tag type of an enum might need to mutate the InternPool by adding a new integer type into it. An alternate strategy would be to pre-heat the InternPool with the integer tag type when creating an enum type, which would make it so that intTagType could accept a const Module instead of a mutable one, asserting that the InternPool already had the integer tag type.
Diffstat (limited to 'src/arch/x86_64/CodeGen.zig')
-rw-r--r--src/arch/x86_64/CodeGen.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig
index c5e3410947..1cfed06ff1 100644
--- a/src/arch/x86_64/CodeGen.zig
+++ b/src/arch/x86_64/CodeGen.zig
@@ -605,7 +605,7 @@ const FrameAlloc = struct {
.ref_count = 0,
};
}
- fn initType(ty: Type, mod: *const Module) FrameAlloc {
+ fn initType(ty: Type, mod: *Module) FrameAlloc {
return init(.{ .size = ty.abiSize(mod), .alignment = ty.abiAlignment(mod) });
}
};
@@ -2309,7 +2309,7 @@ fn allocRegOrMemAdvanced(self: *Self, ty: Type, inst: ?Air.Inst.Index, reg_ok: b
return .{ .load_frame = .{ .index = frame_index } };
}
-fn regClassForType(ty: Type, mod: *const Module) RegisterManager.RegisterBitSet {
+fn regClassForType(ty: Type, mod: *Module) RegisterManager.RegisterBitSet {
return switch (ty.zigTypeTag(mod)) {
.Float, .Vector => sse,
else => gp,