authorgravatar for evan@lagerdata.comEvan Haas <evan@lagerdata.com> 2021-07-26 12:08:29-07:00
committergravatar for evan@lagerdata.comEvan Haas <evan@lagerdata.com> 2021-07-28 08:06:22-07:00
log98eea963deb85d2174262d5f45ddd614a7906231
tree25a61c155dd89350c489bac2f3ab0b4123fc7cd1
parenteb010ce65ddddb23ceddae86d377432cf1b2b01c
signature Commit is signed but in an unrecognized format.

translate-c: fix import path in translation failure comment


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:
19691969 const node = try transExpr(c, scope, expr, used);
19701970 if (node.castTag(.identifier)) |ident| {
19711971 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});
19731973 }
19741974 return node;
19751975}
......@@ -5574,7 +5574,7 @@ fn parseCPrimaryExprInner(c: *Context, m: *MacroCtx, scope: *Scope) ParseError!N
55745574 .Identifier => {
55755575 const mangled_name = scope.getAlias(slice);
55765576 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});
55785578 return error.ParseError;
55795579 }
55805580 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 {
12431243 \\}
12441244 , "");
12451245
1246 // See __builtin_alloca_with_align comment in std.c.builtins
1246 // See __builtin_alloca_with_align comment in std.zig.c_builtins
12471247 cases.add("use of unimplemented builtin in unused function does not prevent compilation",
12481248 \\#include <stdlib.h>
12491249 \\void unused() {
test/translate_c.zig+2-2
......@@ -3461,11 +3461,11 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
34613461 \\pub const MAY_NEED_PROMOTION_OCT = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0o20000000000, .octal);
34623462 });
34633463
3464 // See __builtin_alloca_with_align comment in std.c.builtins
3464 // See __builtin_alloca_with_align comment in std.zig.c_builtins
34653465 cases.add("demote un-implemented builtins",
34663466 \\#define FOO(X) __builtin_alloca_with_align((X), 8)
34673467 , &[_][]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");
34693469 });
34703470
34713471 cases.add("null sentinel arrays when initialized from string literal. Issue #8256",