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.

Change-Id: I70dc56e678f0c1ae48fb8e095e82231efa5d7355
Reviewed-on: https://go-review.googlesource.com/c/143237
Reviewed-by: Than McIntosh <thanm@google.com>
diff --git a/go/export.cc b/go/export.cc
index da3d67f..6365d64 100644
--- a/go/export.cc
+++ b/go/export.cc
@@ -75,12 +75,8 @@
   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.