Skip to content
This repository was archived by the owner on Nov 26, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},

Expand Down
19 changes: 8 additions & 11 deletions lib/helpers.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
Expand Down Expand Up @@ -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))))
Expand Down
4 changes: 4 additions & 0 deletions src/Translator.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down