diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-01-31 02:11:03 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-01-31 02:11:03 +0000 |
commit | 61ddc5ea25a0e5dc691c0c5d4357a47fbdc3ded0 (patch) | |
tree | 4986c8bd54927ce22b11811b7b9951797b8b1c3f /gcc | |
parent | f0ab0c3a96f2c3cfa72dd2df7bc721280ca05a92 (diff) | |
download | gcc-61ddc5ea25a0e5dc691c0c5d4357a47fbdc3ded0.zip gcc-61ddc5ea25a0e5dc691c0c5d4357a47fbdc3ded0.tar.gz gcc-61ddc5ea25a0e5dc691c0c5d4357a47fbdc3ded0.tar.bz2 |
compiler: Function_type and Backend_function_type should not be identical
Function_type and Backend_function_type have different backend
representations, so they should not be identical. Otherwise it
confuses Type::type_btypes map.
Reviewed-on: https://go-review.googlesource.com/90975
From-SVN: r257216
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/types.cc | 3 | ||||
-rw-r--r-- | gcc/go/gofrontend/types.h | 11 |
3 files changed, 15 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index a5e027c..b5d5a28 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -bbce8a9af264b25c5f70bafb2ce95d4fed158d68 +a347356d0f432cafb69f0cc5833d27663736a042 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 3ee9884..a0c81c0 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -4442,6 +4442,9 @@ Function_type::is_identical(const Function_type* t, bool ignore_receiver, Cmp_tags cmp_tags, bool errors_are_identical, std::string* reason) const { + if (this->is_backend_function_type() != t->is_backend_function_type()) + return false; + if (!ignore_receiver) { const Typed_identifier* r1 = this->receiver(); diff --git a/gcc/go/gofrontend/types.h b/gcc/go/gofrontend/types.h index 2703319..4e060a4 100644 --- a/gcc/go/gofrontend/types.h +++ b/gcc/go/gofrontend/types.h @@ -2074,6 +2074,11 @@ class Function_type : public Type Btype* get_backend_fntype(Gogo*); + // Return whether this is a Backend_function_type. + virtual bool + is_backend_function_type() const + { return false; } + protected: int do_traverse(Traverse*); @@ -2167,6 +2172,12 @@ class Backend_function_type : public Function_type : Function_type(receiver, parameters, results, location) { } + // Return whether this is a Backend_function_type. This overrides + // Function_type::is_backend_function_type. + bool + is_backend_function_type() const + { return true; } + protected: Btype* do_get_backend(Gogo* gogo) |