diff options
author | Ian Lance Taylor <iant@golang.org> | 2020-11-16 20:06:53 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-11-20 12:44:35 -0800 |
commit | a01dda3c23b836754814fab1cab949a1bbc641e8 (patch) | |
tree | 826310b88323c0f636baf89393557fde6a56fdeb /gcc/go/gofrontend/export.cc | |
parent | 90bf60c3c24c6c99ebbecf9d08a6d0d916d73721 (diff) | |
download | gcc-a01dda3c23b836754814fab1cab949a1bbc641e8.zip gcc-a01dda3c23b836754814fab1cab949a1bbc641e8.tar.gz gcc-a01dda3c23b836754814fab1cab949a1bbc641e8.tar.bz2 |
compiler, libgo: change mangling scheme
Overhaul the mangling scheme to avoid ambiguities if the package path
contains a dot. Instead of using dot both to separate components and
to mangle characters, use dot only to separate components and use
underscore to mangle characters.
For golang/go#41862
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/271726
Diffstat (limited to 'gcc/go/gofrontend/export.cc')
-rw-r--r-- | gcc/go/gofrontend/export.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/export.cc b/gcc/go/gofrontend/export.cc index 90a5f6d..e99c680 100644 --- a/gcc/go/gofrontend/export.cc +++ b/gcc/go/gofrontend/export.cc @@ -461,7 +461,7 @@ should_export(Named_object* no) return false; // We don't export various special functions. - if (Gogo::is_special_name(no->name())) + if (Gogo::special_name_pos(no->name()) != std::string::npos) return false; // Methods are exported with the type, not here. @@ -524,7 +524,11 @@ struct Sort_types if (t1->classification() != t2->classification()) return t1->classification() < t2->classification(); Gogo* gogo = go_get_gogo(); - return gogo->type_descriptor_name(t1, NULL).compare(gogo->type_descriptor_name(t2, NULL)) < 0; + Backend_name b1; + gogo->type_descriptor_backend_name(t1, NULL, &b1); + Backend_name b2; + gogo->type_descriptor_backend_name(t2, NULL, &b2); + return b1.name() < b2.name(); } }; |