aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-10-15 15:34:14 -0700
committerIan Lance Taylor <iant@golang.org>2020-10-15 16:25:39 -0700
commit1e8e49f135c814bd268289609dd0aea305ed546e (patch)
treec7a9a0681506a9b49d1d65da1d8372d4a2960f6f /gcc
parentf33ac3b0cd9f88be8faadded88e40a511f01c32a (diff)
downloadgcc-1e8e49f135c814bd268289609dd0aea305ed546e.zip
gcc-1e8e49f135c814bd268289609dd0aea305ed546e.tar.gz
gcc-1e8e49f135c814bd268289609dd0aea305ed546e.tar.bz2
compiler: don't export function type parameter names
When hashing a function type the parameter names are ignored. Therefore, we should not write them into the export data. Otherwise, minor changes in the order in which we process the types can cause the export data to change uselessly, leading to unnecessary rebuilds. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/262818
Diffstat (limited to 'gcc')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/types.cc8
2 files changed, 7 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 5355103..7496770 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-71e161daafa1e19c2c53e28fffc3954d88a4cdb2
+3b6252d2d3ce559826303dac07538da6e78940d8
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 e7a742f..eb9c766 100644
--- a/gcc/go/gofrontend/types.cc
+++ b/gcc/go/gofrontend/types.cc
@@ -5182,7 +5182,11 @@ Function_type::do_export(Export* exp) const
first = false;
else
exp->write_c_string(", ");
- exp->write_name(p->name());
+ // The hash for a function type ignores parameter names, so
+ // we don't want to write them out here. If we did write
+ // them out, we could get spurious changes in export data
+ // when recompiling a package.
+ exp->write_name("");
exp->write_c_string(" ");
if (!is_varargs || p + 1 != this->parameters_->end())
exp->write_type(p->type());
@@ -5213,7 +5217,7 @@ Function_type::do_export(Export* exp) const
first = false;
else
exp->write_c_string(", ");
- exp->write_name(p->name());
+ exp->write_name("");
exp->write_c_string(" ");
exp->write_type(p->type());
}