aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-03-23 16:12:26 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-03-23 16:12:26 -0700
commitbe673e67937bbc3e2c74591f8f447f848b2a566a (patch)
treea6784230d35bbb35ea0374984d475228313ac265 /src/Module.zig
parentaa46a705ad998636443e744b63471bf0864e90c9 (diff)
downloadzig-be673e67937bbc3e2c74591f8f447f848b2a566a.tar.gz
zig-be673e67937bbc3e2c74591f8f447f848b2a566a.zip
stage2: implement inttype ZIR
also add i128 and u128 to const inst list
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 112fe5c983..5a2426d6af 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -3599,11 +3599,14 @@ pub fn lookupDeclName(mod: *Module, scope: *Scope, ident_name: []const u8) ?*Dec
return mod.decl_table.get(name_hash);
}
-pub fn makeIntType(arena: *Allocator, signed: bool, bits: u16) !Type {
+pub fn makeIntType(arena: *Allocator, signedness: std.builtin.Signedness, bits: u16) !Type {
const int_payload = try arena.create(Type.Payload.Bits);
int_payload.* = .{
.base = .{
- .tag = if (signed) .int_signed else .int_unsigned,
+ .tag = switch (signedness) {
+ .signed => .int_signed,
+ .unsigned => .int_unsigned,
+ },
},
.data = bits,
};