diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-10-19 19:43:47 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-10-19 19:43:47 +0000 |
commit | 12d5ebf9630364515229268e48c04cffd069dd32 (patch) | |
tree | 2317ee528d8f155674d9a4d87cf3324a9d39392e /gcc/go | |
parent | 3146c60f16558e7eae1039ba6c937f75413ce4f9 (diff) | |
download | gcc-12d5ebf9630364515229268e48c04cffd069dd32.zip gcc-12d5ebf9630364515229268e48c04cffd069dd32.tar.gz gcc-12d5ebf9630364515229268e48c04cffd069dd32.tar.bz2 |
compiler: don't export any functions with special names
This keeps init functions from appearing in the export data. Checking
for special names in general means that we don't need to check
specifically for nested functions or thunks, which have special names.
Reviewed-on: https://go-review.googlesource.com/c/143237
From-SVN: r265321
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/export.cc | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index bb7ab78..1503672 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -6f4bce815786ff3803741355f7f280e4e2c89668 +e1dc92a6037a3f81ea1b8ea8fb6207af33505f0c 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/export.cc b/gcc/go/gofrontend/export.cc index da3d67f..6365d64 100644 --- a/gcc/go/gofrontend/export.cc +++ b/gcc/go/gofrontend/export.cc @@ -75,12 +75,8 @@ should_export(Named_object* no) if (Gogo::is_hidden_name(no->name())) return false; - // We don't export nested functions. - if (no->is_function() && no->func_value()->enclosing() != NULL) - return false; - - // We don't export thunks. - if (no->is_function() && Gogo::is_thunk(no)) + // We don't export various special functions. + if (Gogo::is_special_name(no->name())) return false; // Methods are exported with the type, not here. |