diff mbox

Go patch committed: Fix symbol name adjustments to match go tool

Message ID mcrvbo2pd7f.fsf@iant-glaptop.roam.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor Oct. 2, 2014, 5:56 p.m. UTC
In the go tool, when converting the pkgpath argument to use for a symbol
name, everything except alphanumeric characters is converted to an
underscore character.  This is PR 61880.  This patch from Alexander
Shopov changes the Go frontend to match, so that the symbol names
generated by the cgo tool come out the same.  Bootstrapped and ran Go
testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

Comments

Ian Lance Taylor Oct. 2, 2014, 5:58 p.m. UTC | #1
On Thu, Oct 2, 2014 at 10:56 AM, Ian Lance Taylor <iant@google.com> wrote:
> In the go tool, when converting the pkgpath argument to use for a symbol
> name, everything except alphanumeric characters is converted to an
> underscore character.  This is PR 61880.  This patch from Alexander
> Shopov changes the Go frontend to match, so that the symbol names
> generated by the cgo tool come out the same.  Bootstrapped and ran Go
> testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Forgot to say: also committing to 4.9 branch.

Ian
diff mbox

Patch

diff -r 82a9d752ff1f go/gogo.cc
--- a/go/gogo.cc	Thu Oct 02 10:53:01 2014 -0700
+++ b/go/gogo.cc	Thu Oct 02 10:54:51 2014 -0700
@@ -258,10 +258,7 @@ 
       char c = s[i];
       if ((c >= 'a' && c <= 'z')
 	  || (c >= 'A' && c <= 'Z')
-	  || (c >= '0' && c <= '9')
-	  || c == '_'
-	  || c == '.'
-	  || c == '$')
+	  || (c >= '0' && c <= '9'))
 	;
       else
 	s[i] = '_';