diff --git a/build.zig.zon b/build.zig.zon index 404b2f1..a1535e9 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -5,12 +5,12 @@ .fingerprint = 0x1c84f6455a54f043, // Changing this has security and trust implications. - .minimum_zig_version = "0.16.0-dev.1334+06d08daba", + .minimum_zig_version = "0.16.0-dev.1456+16fc083f2", .dependencies = .{ .aro = .{ - .url = "git+https://github.com/Vexu/arocc#d84be01a6a85ac91f51b3ad7647ca356db3f3c76", - .hash = "aro-0.0.0-JSD1QvVvNgCxkaLWsgk1JClDUgsxTcPrUo43odmNIGT2", + .url = "git+https://github.com/Vexu/arocc#967f8b03ea19f43f8c1c009d7c1f5398bbd79246", + .hash = "aro-0.0.0-JSD1Qi2TNgAqcz8WhBqh5B4FcjLw2WZCvRMqPfT8Q9gY", }, }, diff --git a/lib/helpers.zig b/lib/helpers.zig index 5f6a556..37bb2ee 100644 --- a/lib/helpers.zig +++ b/lib/helpers.zig @@ -85,16 +85,13 @@ fn ToUnsigned(comptime T: type) type { pub fn FlexibleArrayType(comptime SelfType: type, comptime ElementType: type) type { switch (@typeInfo(SelfType)) { .pointer => |ptr| { - return @Type(.{ .pointer = .{ - .size = .c, - .is_const = ptr.is_const, - .is_volatile = ptr.is_volatile, - .alignment = @alignOf(ElementType), - .address_space = .generic, - .child = ElementType, - .is_allowzero = true, - .sentinel_ptr = null, - } }); + return @Pointer(.c, .{ + .@"const" = ptr.is_const, + .@"volatile" = ptr.is_volatile, + .@"allowzero" = true, + .@"addrspace" = .generic, + .@"align" = @alignOf(ElementType), + }, ElementType, null); }, else => |info| @compileError("Invalid self type \"" ++ @tagName(info) ++ "\" for flexible array getter: " ++ @typeName(SelfType)), } @@ -219,7 +216,7 @@ fn castInt(comptime DestType: type, target: anytype) DestType { const dest = @typeInfo(DestType).int; const source = @typeInfo(@TypeOf(target)).int; - const Int = @Type(.{ .int = .{ .bits = dest.bits, .signedness = source.signedness } }); + const Int = @Int(source.signedness, dest.bits); if (dest.bits < source.bits) return @as(DestType, @bitCast(@as(Int, @truncate(target)))) diff --git a/src/Translator.zig b/src/Translator.zig index 80ddd5c..bf3f5a1 100644 --- a/src/Translator.zig +++ b/src/Translator.zig @@ -2241,6 +2241,10 @@ fn transExpr(t: *Translator, scope: *Scope, expr: Node.Index, used: ResultUsed) .builtin_convertvector => |convertvector| try t.transConvertvectorExpr(scope, convertvector), .builtin_shufflevector => |shufflevector| try t.transShufflevectorExpr(scope, shufflevector), + .builtin_va_arg_pack, .builtin_va_arg_pack_len => |va_arg_pack| { + return t.fail(error.UnsupportedTranslation, va_arg_pack.builtin_tok, "TODO va arg pack", .{}); + }, + .compound_stmt, .static_assert, .return_stmt,