fix translate-c regression

clang.zig had incorrect enum for builtin types
master
Andrew Kelley 2020-01-30 18:43:54 -05:00
parent c5df0b3e9d
commit a475877007
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
3 changed files with 17 additions and 0 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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);