aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-03-16 20:40:16 +0200
committerGitHub <noreply@github.com>2022-03-16 20:40:16 +0200
commit49c0bb1f33044658909cae4351d931af497ee4e5 (patch)
treeabf9ecce7f08db5b5f92ed30e3fc3f40b926acc3 /src/type.zig
parentd4a7a9ac4cf64ef6bf0b1aed16282c3d8b47b431 (diff)
parentd83a26f068f42c6f9cafd25b7038b70553a496d8 (diff)
downloadzig-49c0bb1f33044658909cae4351d931af497ee4e5.tar.gz
zig-49c0bb1f33044658909cae4351d931af497ee4e5.zip
Merge pull request #11177 from Vexu/dbg_func
Add debug info for inlined calls
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/type.zig b/src/type.zig
index f7aae88df5..b3edc87585 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -486,6 +486,36 @@ pub const Type = extern union {
.pointer => return self.castTag(.pointer).?.*,
+ .optional_single_mut_pointer => return .{ .data = .{
+ .pointee_type = self.castPointer().?.data,
+ .sentinel = null,
+ .@"align" = 0,
+ .@"addrspace" = .generic,
+ .bit_offset = 0,
+ .host_size = 0,
+ .@"allowzero" = false,
+ .mutable = true,
+ .@"volatile" = false,
+ .size = .One,
+ } },
+ .optional_single_const_pointer => return .{ .data = .{
+ .pointee_type = self.castPointer().?.data,
+ .sentinel = null,
+ .@"align" = 0,
+ .@"addrspace" = .generic,
+ .bit_offset = 0,
+ .host_size = 0,
+ .@"allowzero" = false,
+ .mutable = false,
+ .@"volatile" = false,
+ .size = .One,
+ } },
+ .optional => {
+ var buf: Payload.ElemType = undefined;
+ const child_type = self.optionalChild(&buf);
+ return child_type.ptrInfo();
+ },
+
else => unreachable,
}
}