From 3c34c313cf999238753b34f01b0437a552fb3be0 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 11 Apr 2020 17:55:49 -0400 Subject: [PATCH] revert Translate C: Add comment containing c source location for failed decls This reverts 0db108101a30a2ac5ec4dc9911d488f9036256b8. Unfortunately this caused a regression. Closes #5007. --- src-self-hosted/translate_c.zig | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src-self-hosted/translate_c.zig b/src-self-hosted/translate_c.zig index 508d781b7..a88cc8e81 100644 --- a/src-self-hosted/translate_c.zig +++ b/src-self-hosted/translate_c.zig @@ -3058,7 +3058,6 @@ fn transCreateCompoundAssign( // common case // c: lhs += rhs // zig: lhs += rhs - if ((is_mod or is_div) and is_signed) { const op_token = try appendToken(rp.c, .Equal, "="); 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 const msg_tok = try appendTokenFmt(c, .StringLiteral, "\"" ++ format ++ "\"", args); const rparen_tok = try appendToken(c, .RParen, ")"); const semi_tok = try appendToken(c, .Semicolon, ";"); - _ = try appendTokenFmt(c, .LineComment, "// {}", .{c.locStr(loc)}); const msg_node = try c.a().create(ast.Node.StringLiteral); msg_node.* = ast.Node.StringLiteral{ @@ -5442,7 +5440,7 @@ fn parseCPrimaryExpr(c: *Context, it: *CTokenList.Iterator, source: []const u8, }; return &node.base; } else { - const token = try appendTokenFmt(c, .IntegerLiteral, "0x{x}", .{source[tok.start+1..tok.end-1]}); + const token = try appendTokenFmt(c, .IntegerLiteral, "0x{x}", .{source[tok.start + 1 .. tok.end - 1]}); const node = try c.a().create(ast.Node.IntegerLiteral); node.* = .{ .token = token,