aboutsummaryrefslogtreecommitdiff
path: root/src/type.zig
diff options
context:
space:
mode:
authorJacob G-W <jacoblevgw@gmail.com>2021-08-22 02:13:18 -0400
committerJacob G-W <jacoblevgw@gmail.com>2021-08-30 22:54:33 -0400
commit353eec73cad82ed0783fe76837cbb94095f79f9d (patch)
tree8d41af9a0c1a28303e65ca7ef61d18c9ace328a7 /src/type.zig
parent861b784454aa2ed3365b31dc18f9f569bc637703 (diff)
downloadzig-353eec73cad82ed0783fe76837cbb94095f79f9d.tar.gz
zig-353eec73cad82ed0783fe76837cbb94095f79f9d.zip
stage2: add array concatenation
Diffstat (limited to 'src/type.zig')
-rw-r--r--src/type.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/type.zig b/src/type.zig
index 467e9c931b..aa4517ab05 100644
--- a/src/type.zig
+++ b/src/type.zig
@@ -273,6 +273,15 @@ pub const Type = extern union {
};
}
+ pub const ArrayInfo = struct { elem_type: Type, sentinel: ?Value = null, len: u64 };
+ pub fn arrayInfo(self: Type) ArrayInfo {
+ return .{
+ .len = self.arrayLen(),
+ .sentinel = self.sentinel(),
+ .elem_type = self.elemType(),
+ };
+ }
+
pub fn ptrInfo(self: Type) Payload.Pointer {
switch (self.tag()) {
.single_const_pointer_to_comptime_int => return .{ .data = .{