From patchwork Mon Dec 3 06:57:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 203295 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 5A3D02C00A7 for ; Mon, 3 Dec 2012 17:57:50 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1355122672; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=Brk78Zu 8H3BOkxhwNRyLrxJqK+I=; b=WtussHhh/znIcpgpXftfdgv0LrlCyUw9IfmnHYB 4Avnhen+JKqozxmOrObjG5KBOAInJ+GvUTDgkn8s9BoEm1ACw0OQ6I6bqqgoE29f eSCe5306XkkY9q4jAqQflCWPgxe1TFA68jzMdJvxOPJGvqYpbPIztX8VxhDK7vL0 dGBQ= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=bCMtze52oN/CfDdifb8qagBrM3aJra/TIlm3s+KcJMIDfIA03qOw0P9d+gQldK L6hqteMHroV8O24PADzoURTGakfPGm/x9kJulGWOCL2CxDAF9mJP2lbjdOO9MCDU 5yLG8zbQMqcSUzVW0xamMKMsD8mw4bRM+u5RYuAK/IyG4=; Received: (qmail 30896 invoked by alias); 3 Dec 2012 06:57:29 -0000 Received: (qmail 30873 invoked by uid 22791); 3 Dec 2012 06:57:25 -0000 X-SWARE-Spam-Status: No, hits=-4.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-pa0-f47.google.com (HELO mail-pa0-f47.google.com) (209.85.220.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 03 Dec 2012 06:57:18 +0000 Received: by mail-pa0-f47.google.com with SMTP id fa10so1496392pad.20 for ; Sun, 02 Dec 2012 22:57:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type:x-gm-message-state; bh=Kuv+xENB+PVamXl2jyKB/Q9QyDpVk0GatxeOLZITJ1w=; b=E4UfRrsqiEaD9yurGHH3x4AK4TaIUnwPhZ5gUooN5mEHm/unmc3FhUWCd5vbR60qz7 J0AEPxxMMmq3AWRLsBdXybebN2yKhtfMWjj/CZHo7GTLTxB3ZTrzbkC18wJfh47Lee+q BIigthafjQn01rPTra/36ic0zWOTErA5vuOlK7nkb3a/aDbR8tT5OlfJeqPaXMnCbXTm 8mH0iUglw/6eVvDwGXKfr0TuTrvxJM1V7uJV1j+EkSup++CPy54YgkqzRfdVck96H4RL eMgvD8rWedoJITw+Nf33mfZYH8UDEIpWo6qR6wM4eI4FMYLBMMuz97MXGYM+0msLqSTR Ftgw== Received: by 10.66.72.225 with SMTP id g1mr23409812pav.79.1354517838417; Sun, 02 Dec 2012 22:57:18 -0800 (PST) Received: from coign.google.com ([2401:fa00:0:9:224:d7ff:fe8f:f634]) by mx.google.com with ESMTPS id a4sm7553851paw.21.2012.12.02.22.57.15 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Dec 2012 22:57:17 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Go patch committed: Don't encode non-ASCII characters in identifiers Date: Sun, 02 Dec 2012 22:57:12 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQl0EBm/O0NpsDcOKdeVxmdxgkyw4k58EmgN2T2P0ZRmv7rFrxbTF9MVtOgIyUwMgX4ym4YiREfsWtrdY3OG4w7qnSLZyrzGWs3RfhIAAgfCiCiGrW3rlrNJyh5hyAjP/2ZBg6pCjDXOqWIY55InEHjhjRB9tIhIfCIzKdnkWRqlm5zFrhkIksJ5zbdLaDkFYX6yNtD8 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Go permits non-ASCII characters in identifiers. A long time ago I thought I needed to encode those before passing them to GIMPLE. Looking at the -fextended-identifiers support, I see that that should not be true. This patch removes the encoding. This should give a better debugging experience and will fix the names used in type reflection. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r c2163c885896 go/lex.cc --- a/go/lex.cc Sun Dec 02 19:23:21 2012 -0800 +++ b/go/lex.cc Sun Dec 02 22:49:14 2012 -0800 @@ -915,12 +915,8 @@ } if (is_invalid && !Lex::is_invalid_identifier(buf)) buf.append("$INVALID$"); + buf.append(p, pnext - p); p = pnext; - char ubuf[50]; - // This assumes that all assemblers can handle an identifier - // with a '$' character. - snprintf(ubuf, sizeof ubuf, "$U%x$", ci); - buf.append(ubuf); } } Location location = this->location();