diff --git a/lib/std/zig/ast.zig b/lib/std/zig/ast.zig index dc9a6bc7ca39ed9017c0edb2ff5c14bfbe5ed952..a693c5f87fdac960970f84445f515c6d68b3b6d6 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 fd001f1a2af2fab36f79cbe42d146284c3cdaa38..08a10f8378cd2cf57dbc242abfa3f589504626c1 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 d4df998774a39f27fcdf4ad3f05d3fc087288ac8..9373487ca3e4ee6dfbf24b8e1ea576e7bf09d1cc 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);