diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-01-11 16:28:08 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-01-11 16:28:08 +0000 |
commit | 145f71b5ecfaf5efca5689f0fa84b78a7c5c70be (patch) | |
tree | d8215ca00c4d575fe3d1fc83c41c31e260de6344 /gcc | |
parent | 58ef756802595e58666ab05ca636f9da8ebe6dfe (diff) | |
download | gcc-145f71b5ecfaf5efca5689f0fa84b78a7c5c70be.zip gcc-145f71b5ecfaf5efca5689f0fa84b78a7c5c70be.tar.gz gcc-145f71b5ecfaf5efca5689f0fa84b78a7c5c70be.tar.bz2 |
compiler: Fix names for hash/equality functions for unnamed types.
From-SVN: r183098
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/types.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index d93b68b..21dac51 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -1504,7 +1504,17 @@ Type::specific_type_functions(Gogo* gogo, Named_type* name, std::string base_name; if (name == NULL) - base_name = gogo->pack_hidden_name(this->mangled_name(gogo), false); + { + // Mangled names can have '.' if they happen to refer to named + // types in some way. That's fine if this is simply a named + // type, but otherwise it will confuse the code that builds + // function identifiers. Remove '.' when necessary. + base_name = this->mangled_name(gogo); + size_t i; + while ((i = base_name.find('.')) != std::string::npos) + base_name[i] = '$'; + base_name = gogo->pack_hidden_name(base_name, false); + } else { // This name is already hidden or not as appropriate. |