authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-30 18:43:54-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-30 18:43:54-05:00
loga475877007901138df0231b0d0d7233cf2217095
treef0818d4624138054d3678f389b3727f41fd97efb
parentc5df0b3e9d8b0a9186cde887a1893bd2be3dbbae
signature Commit is signed but in an unrecognized format.

fix translate-c regression

clang.zig had incorrect enum for builtin types

3 files changed, 17 insertions(+), 0 deletions(-)

lib/std/zig/ast.zig+4
......@@ -10,10 +10,14 @@ pub const TokenIndex = usize;
1010pub const Tree = struct {
1111 source: []const u8,
1212 tokens: TokenList,
13
1314 /// undefined on parse error (errors not empty)
1415 root_node: *Node.Root,
1516 arena_allocator: std.heap.ArenaAllocator,
1617 errors: ErrorList,
18
19 /// translate-c uses this to avoid having to emit correct newlines
20 /// TODO get rid of this hack
1721 generated: bool = false,
1822
1923 pub const TokenList = SegmentedList(Token, 64);
src-self-hosted/clang.zig+12
......@@ -612,6 +612,18 @@ pub const ZigClangBuiltinTypeKind = extern enum {
612612 OCLIntelSubgroupAVCImeResultDualRefStreamout,
613613 OCLIntelSubgroupAVCImeSingleRefStreamin,
614614 OCLIntelSubgroupAVCImeDualRefStreamin,
615 SveInt8,
616 SveInt16,
617 SveInt32,
618 SveInt64,
619 SveUint8,
620 SveUint16,
621 SveUint32,
622 SveUint64,
623 SveFloat16,
624 SveFloat32,
625 SveFloat64,
626 SveBool,
615627 Void,
616628 Bool,
617629 Char_U,
src-self-hosted/translate_c.zig+1
......@@ -4716,6 +4716,7 @@ fn appendToken(c: *Context, token_id: Token.Id, bytes: []const u8) !ast.TokenInd
47164716}
47174717
47184718fn appendTokenFmt(c: *Context, token_id: Token.Id, comptime format: []const u8, args: var) !ast.TokenIndex {
4719 assert(token_id != .Invalid);
47194720 const S = struct {
47204721 fn callback(context: *Context, bytes: []const u8) error{OutOfMemory}!void {
47214722 return context.source_buffer.append(bytes);