summaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-03 05:27:16 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-03 05:27:16 +0000
commitba32660f7442301b9adfd81793b288a4c9d7c5a2 (patch)
tree3abff5cd3ab2c4332a14ab9b44add5c578b828c5 /gcc/go
parent31d35b7194c0edfc269571d4808f5679010b8cfd (diff)
downloadgcc-ba32660f7442301b9adfd81793b288a4c9d7c5a2.tar.gz
compiler: Unpack method names when sorting them.
Reviewed-on: https://go-review.googlesource.com/19177 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233097 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/types.cc13
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 755dee5aab1..3fb2a3e0c87 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-8dce33f24dd3a34e3574c1d2604428586b63c1aa
+a408bef550251926c28673818db2c64302faac1d
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc
index 52a1e4da886..c43d0645a0f 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -2307,7 +2307,10 @@ class Sort_methods
bool
operator()(const std::pair<std::string, const Method*>& m1,
const std::pair<std::string, const Method*>& m2) const
- { return m1.first < m2.first; }
+ {
+ return (Gogo::unpack_hidden_name(m1.first)
+ < Gogo::unpack_hidden_name(m2.first));
+ }
};
// Return a composite literal for the type method table for this type.
@@ -7684,7 +7687,8 @@ Interface_type::get_backend_methods(Gogo* gogo)
mfields[i].location = loc;
// Sanity check: the names should be sorted.
- go_assert(p->name() > last_name);
+ go_assert(Gogo::unpack_hidden_name(p->name())
+ > Gogo::unpack_hidden_name(last_name));
last_name = p->name();
}
@@ -10489,7 +10493,10 @@ struct Typed_identifier_list_sort
public:
bool
operator()(const Typed_identifier& t1, const Typed_identifier& t2) const
- { return t1.name() < t2.name(); }
+ {
+ return (Gogo::unpack_hidden_name(t1.name())
+ < Gogo::unpack_hidden_name(t2.name()));
+ }
};
void