diff --git a/lib/std/zig/ast.zig b/lib/std/zig/ast.zig index dc9a6bc7ca..a693c5f87f 100644 --- a/lib/std/zig/ast.zig +++ b/lib/std/zig/ast.zig @@ -10,10 +10,14 @@ pub const TokenIndex = usize; pub const Tree = struct { source: []const u8, tokens: TokenList, + /// undefined on parse error (errors not empty) root_node: *Node.Root, arena_allocator: std.heap.ArenaAllocator, errors: ErrorList, + + /// translate-c uses this to avoid having to emit correct newlines + /// TODO get rid of this hack generated: bool = false, pub const TokenList = SegmentedList(Token, 64); diff --git a/src-self-hosted/clang.zig b/src-self-hosted/clang.zig index fd001f1a2a..08a10f8378 100644 --- a/src-self-hosted/clang.zig +++ b/src-self-hosted/clang.zig @@ -612,6 +612,18 @@ pub const ZigClangBuiltinTypeKind = extern enum { OCLIntelSubgroupAVCImeResultDualRefStreamout, OCLIntelSubgroupAVCImeSingleRefStreamin, OCLIntelSubgroupAVCImeDualRefStreamin, + SveInt8, + SveInt16, + SveInt32, + SveInt64, + SveUint8, + SveUint16, + SveUint32, + SveUint64, + SveFloat16, + SveFloat32, + SveFloat64, + SveBool, Void, Bool, Char_U, diff --git a/src-self-hosted/translate_c.zig b/src-self-hosted/translate_c.zig index d4df998774..9373487ca3 100644 --- a/src-self-hosted/translate_c.zig +++ b/src-self-hosted/translate_c.zig @@ -4716,6 +4716,7 @@ fn appendToken(c: *Context, token_id: Token.Id, bytes: []const u8) !ast.TokenInd } fn appendTokenFmt(c: *Context, token_id: Token.Id, comptime format: []const u8, args: var) !ast.TokenIndex { + assert(token_id != .Invalid); const S = struct { fn callback(context: *Context, bytes: []const u8) error{OutOfMemory}!void { return context.source_buffer.append(bytes);