* Go patch committed: Function_type and Backend_function_type are not identical
@ 2018-01-31 6:17 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2018-01-31 6:17 UTC (permalink / raw)
To: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 255 bytes --]
This patch by Cherry Zhang fixes the Go frontend so that Function_type
and Backend_function_type are not identical, since they have different
backend representations. Bootstrapped and ran Go testsuite on
x86_64-pc-linux-gnu. Committed to mainline.
Ian
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1779 bytes --]
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE (revision 257171)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -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.
Index: gcc/go/gofrontend/types.cc
===================================================================
--- gcc/go/gofrontend/types.cc (revision 257069)
+++ gcc/go/gofrontend/types.cc (working copy)
@@ -4442,6 +4442,9 @@ Function_type::is_identical(const Functi
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();
Index: gcc/go/gofrontend/types.h
===================================================================
--- gcc/go/gofrontend/types.h (revision 257069)
+++ gcc/go/gofrontend/types.h (working copy)
@@ -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 Fun
: 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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-01-31 2:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31 6:17 Go patch committed: Function_type and Backend_function_type are not identical Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).