Commit 12d5ebf9 by Ian Lance Taylor

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
parent 3146c60f
6f4bce815786ff3803741355f7f280e4e2c89668 e1dc92a6037a3f81ea1b8ea8fb6207af33505f0c
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -75,12 +75,8 @@ should_export(Named_object* no) ...@@ -75,12 +75,8 @@ should_export(Named_object* no)
if (Gogo::is_hidden_name(no->name())) if (Gogo::is_hidden_name(no->name()))
return false; return false;
// We don't export nested functions. // We don't export various special functions.
if (no->is_function() && no->func_value()->enclosing() != NULL) if (Gogo::is_special_name(no->name()))
return false;
// We don't export thunks.
if (no->is_function() && Gogo::is_thunk(no))
return false; return false;
// Methods are exported with the type, not here. // Methods are exported with the type, not here.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment