aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-10-15 10:04:52 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-10-15 10:36:10 -0700
commit66d6183001e135e36df06194e29f082eb63503ec (patch)
treec7d4973f437fde43735ac8c08cb8e12f5e66257f /src/type.zig
parent1087e677625b0846cf25dc43474a63f9a25f1e32 (diff)
parent9ff60e356ec5be9c3e547d0db2b55bba88c0acbd (diff)
downloadzig-66d6183001e135e36df06194e29f082eb63503ec.tar.gz
zig-66d6183001e135e36df06194e29f082eb63503ec.zip
Merge branch 'amdgpu-improvements' of https://github.com/Snektron/zig into Snektron-amdgpu-improvements
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/type.zig b/src/type.zig
index bd0718481a..3b46546df0 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -2786,6 +2786,12 @@ pub const Type = extern union {
.pointer => self.castTag(.pointer).?.data.@"addrspace",
+ .optional => {
+ var buf: Payload.ElemType = undefined;
+ const child_type = self.optionalChild(&buf);
+ return child_type.ptrAddressSpace();
+ },
+
else => unreachable,
};
}
@@ -6768,6 +6774,13 @@ pub const CType = enum {
},
},
+ .amdhsa, .amdpal => switch (self) {
+ .short, .ushort => return 16,
+ .int, .uint => return 32,
+ .long, .ulong, .longlong, .ulonglong => return 64,
+ .longdouble => return 128,
+ },
+
.cloudabi,
.kfreebsd,
.lv2,
@@ -6777,13 +6790,11 @@ pub const CType = enum {
.aix,
.cuda,
.nvcl,
- .amdhsa,
.ps4,
.ps5,
.elfiamcu,
.mesa3d,
.contiki,
- .amdpal,
.hermit,
.hurd,
.opencl,