From patchwork Mon Dec 3 06:57:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Go patch committed: Don't encode non-ASCII characters in identifiers Date: Sun, 02 Dec 2012 20:57:12 -0000 From: Ian Taylor X-Patchwork-Id: 203295 Message-Id: To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com 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();