authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-04-11 17:55:49-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-04-11 17:56:48-04:00
log3c34c313cf999238753b34f01b0437a552fb3be0
treea191e0bf9075e1aade1d387b1ca7fa07275bed96
parent4ceaa0595a02b3695e37bd999bd58efb7c1e0550

revert Translate C: Add comment containing c source location for failed decls

This reverts 0db108101a30a2ac5ec4dc9911d488f9036256b8. Unfortunately this caused a regression. Closes #5007.

1 files changed, 1 insertions(+), 3 deletions(-)

src-self-hosted/translate_c.zig+1-3
......@@ -3058,7 +3058,6 @@ fn transCreateCompoundAssign(
30583058 // common case
30593059 // c: lhs += rhs
30603060 // zig: lhs += rhs
3061
30623061 if ((is_mod or is_div) and is_signed) {
30633062 const op_token = try appendToken(rp.c, .Equal, "=");
30643063 const op_node = try rp.c.a().create(ast.Node.InfixOp);
......@@ -4773,7 +4772,6 @@ pub fn failDecl(c: *Context, loc: ZigClangSourceLocation, name: []const u8, comp
47734772 const msg_tok = try appendTokenFmt(c, .StringLiteral, "\"" ++ format ++ "\"", args);
47744773 const rparen_tok = try appendToken(c, .RParen, ")");
47754774 const semi_tok = try appendToken(c, .Semicolon, ";");
4776 _ = try appendTokenFmt(c, .LineComment, "// {}", .{c.locStr(loc)});
47774775
47784776 const msg_node = try c.a().create(ast.Node.StringLiteral);
47794777 msg_node.* = ast.Node.StringLiteral{
......@@ -5442,7 +5440,7 @@ fn parseCPrimaryExpr(c: *Context, it: *CTokenList.Iterator, source: []const u8,
54425440 };
54435441 return &node.base;
54445442 } else {
5445 const token = try appendTokenFmt(c, .IntegerLiteral, "0x{x}", .{source[tok.start+1..tok.end-1]});
5443 const token = try appendTokenFmt(c, .IntegerLiteral, "0x{x}", .{source[tok.start + 1 .. tok.end - 1]});
54465444 const node = try c.a().create(ast.Node.IntegerLiteral);
54475445 node.* = .{
54485446 .token = token,