| author | |
| committer | |
| log | 98eea963deb85d2174262d5f45ddd614a7906231 |
| tree | 25a61c155dd89350c489bac2f3ab0b4123fc7cd1 |
| parent | eb010ce65ddddb23ceddae86d377432cf1b2b01c |
| signature |
3 files changed, 5 insertions(+), 5 deletions(-)
src/translate_c.zig+2-2| ... | @@ -1969,7 +1969,7 @@ fn transBuiltinFnExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used: | ... | @@ -1969,7 +1969,7 @@ fn transBuiltinFnExpr(c: *Context, scope: *Scope, expr: *const clang.Expr, used: |
| 1969 | const node = try transExpr(c, scope, expr, used); | 1969 | const node = try transExpr(c, scope, expr, used); |
| 1970 | if (node.castTag(.identifier)) |ident| { | 1970 | if (node.castTag(.identifier)) |ident| { |
| 1971 | const name = ident.data; | 1971 | const name = ident.data; |
| 1972 | if (!isBuiltinDefined(name)) return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "TODO implement function '{s}' in std.c.builtins", .{name}); | 1972 | if (!isBuiltinDefined(name)) return fail(c, error.UnsupportedTranslation, expr.getBeginLoc(), "TODO implement function '{s}' in std.zig.c_builtins", .{name}); |
| 1973 | } | 1973 | } |
| 1974 | return node; | 1974 | return node; |
| 1975 | } | 1975 | } |
| ... | @@ -5574,7 +5574,7 @@ fn parseCPrimaryExprInner(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!N | ... | @@ -5574,7 +5574,7 @@ fn parseCPrimaryExprInner(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!N |
| 5574 | .Identifier => { | 5574 | .Identifier => { |
| 5575 | const mangled_name = scope.getAlias(slice); | 5575 | const mangled_name = scope.getAlias(slice); |
| 5576 | if (mem.startsWith(u8, mangled_name, "__builtin_") and !isBuiltinDefined(mangled_name)) { | 5576 | if (mem.startsWith(u8, mangled_name, "__builtin_") and !isBuiltinDefined(mangled_name)) { |
| 5577 | try m.fail(c, "TODO implement function '{s}' in std.c.builtins", .{mangled_name}); | 5577 | try m.fail(c, "TODO implement function '{s}' in std.zig.c_builtins", .{mangled_name}); |
| 5578 | return error.ParseError; | 5578 | return error.ParseError; |
| 5579 | } | 5579 | } |
| 5580 | const identifier = try Tag.identifier.create(c.arena, builtin_typedef_map.get(mangled_name) orelse mangled_name); | 5580 | const identifier = try Tag.identifier.create(c.arena, builtin_typedef_map.get(mangled_name) orelse mangled_name); |
test/run_translated_c.zig+1-1| ... | @@ -1243,7 +1243,7 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void { | ... | @@ -1243,7 +1243,7 @@ pub fn addCases(cases: *tests.RunTranslatedCContext) void { |
| 1243 | \\} | 1243 | \\} |
| 1244 | , ""); | 1244 | , ""); |
| 1245 | 1245 | ||
| 1246 | // See __builtin_alloca_with_align comment in std.c.builtins | 1246 | // See __builtin_alloca_with_align comment in std.zig.c_builtins |
| 1247 | cases.add("use of unimplemented builtin in unused function does not prevent compilation", | 1247 | cases.add("use of unimplemented builtin in unused function does not prevent compilation", |
| 1248 | \\#include <stdlib.h> | 1248 | \\#include <stdlib.h> |
| 1249 | \\void unused() { | 1249 | \\void unused() { |
test/translate_c.zig+2-2| ... | @@ -3461,11 +3461,11 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -3461,11 +3461,11 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 3461 | \\pub const MAY_NEED_PROMOTION_OCT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0o20000000000, .octal); | 3461 | \\pub const MAY_NEED_PROMOTION_OCT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0o20000000000, .octal); |
| 3462 | }); | 3462 | }); |
| 3463 | 3463 | ||
| 3464 | // See __builtin_alloca_with_align comment in std.c.builtins | 3464 | // See __builtin_alloca_with_align comment in std.zig.c_builtins |
| 3465 | cases.add("demote un-implemented builtins", | 3465 | cases.add("demote un-implemented builtins", |
| 3466 | \\#define FOO(X) __builtin_alloca_with_align((X), 8) | 3466 | \\#define FOO(X) __builtin_alloca_with_align((X), 8) |
| 3467 | , &[_][]const u8{ | 3467 | , &[_][]const u8{ |
| 3468 | \\pub const FOO = @compileError("TODO implement function '__builtin_alloca_with_align' in std.c.builtins"); | 3468 | \\pub const FOO = @compileError("TODO implement function '__builtin_alloca_with_align' in std.zig.c_builtins"); |
| 3469 | }); | 3469 | }); |
| 3470 | 3470 | ||
| 3471 | cases.add("null sentinel arrays when initialized from string literal. Issue #8256", | 3471 | cases.add("null sentinel arrays when initialized from string literal. Issue #8256", |