compiler: rationalize external symbol names
authorIan Lance Taylor <iant@golang.org>
Wed, 24 Jan 2018 23:50:09 +0000 (23:50 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Wed, 24 Jan 2018 23:50:09 +0000 (23:50 +0000)
commit4880b994d63ffb014a5a547239e9cd8402bb014a
treea782ef29045ab50de17cac215b8c30c9a3b61aa2
parentd3719ee2c078a1518c9e21efae0cf438d4ffb8d6
compiler: rationalize external symbol names

    Encode all external symbol names using only ASCII alphanumeric
    characters, underscore, and dot.  Use a scheme that can be reliably
    demangled to a somewhat readable version as described in the long
    comment in names.cc.

    A minor cleanup discovered during this was that we were treating
    function types as different if one had a NULL parameters_ field and
    another has a non-NULL parameters_ field that has no parameters.  This
    worked because we mangled them slightly differently.  We now mangle
    them the same, so we treat them as equal, as we should anyhow.

    Reviewed-on: https://go-review.googlesource.com/89555

* go.go-torture/execute/names-1.go: New test.

From-SVN: r257033
19 files changed:
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/escape.cc
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/go-encode-id.cc
gcc/go/gofrontend/go-encode-id.h
gcc/go/gofrontend/gogo.cc
gcc/go/gofrontend/gogo.h
gcc/go/gofrontend/lex.cc
gcc/go/gofrontend/names.cc
gcc/go/gofrontend/statements.cc
gcc/go/gofrontend/types.cc
gcc/testsuite/ChangeLog
gcc/testsuite/go.go-torture/execute/names-1.go [new file with mode: 0644]
libgo/go/runtime/crash_test.go
libgo/go/runtime/panic.go
libgo/go/runtime/pprof/pprof_test.go
libgo/go/syscall/wait.c
libgo/runtime/go-callers.c
libgo/runtime/go-unsafe-pointer.c