Commit 7f8c0c05 by Ian Lance Taylor

compiler: if hidden function referenced by inline, don't hide descriptor

    
    Fixes golang/go#33739
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/191037

From-SVN: r274800
parent 077eb7af
1846b07fec2b91facc02ea269f7ab250b30f90b4 7da359f4659fffff051c05ff442037cfa61febd5
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.
...@@ -1560,10 +1560,14 @@ Func_descriptor_expression::do_get_backend(Translate_context* context) ...@@ -1560,10 +1560,14 @@ Func_descriptor_expression::do_get_backend(Translate_context* context)
|| no->name().find("equal") != std::string::npos)) || no->name().find("equal") != std::string::npos))
is_exported_runtime = true; is_exported_runtime = true;
bool is_referenced_by_inline =
no->is_function() && no->func_value()->is_referenced_by_inline();
bool is_hidden = ((no->is_function() bool is_hidden = ((no->is_function()
&& no->func_value()->enclosing() != NULL) && no->func_value()->enclosing() != NULL)
|| (Gogo::is_hidden_name(no->name()) || (Gogo::is_hidden_name(no->name())
&& !is_exported_runtime) && !is_exported_runtime
&& !is_referenced_by_inline)
|| Gogo::is_thunk(no)); || Gogo::is_thunk(no));
bvar = context->backend()->immutable_struct(var_name, asm_name, bvar = context->backend()->immutable_struct(var_name, asm_name,
......
...@@ -1543,6 +1543,11 @@ class Function ...@@ -1543,6 +1543,11 @@ class Function
set_is_inline_only() set_is_inline_only()
{ this->is_inline_only_ = true; } { this->is_inline_only_ = true; }
// Report whether the function is referenced by an inline body.
bool
is_referenced_by_inline() const
{ return this->is_referenced_by_inline_; }
// Mark the function as referenced by an inline body. // Mark the function as referenced by an inline body.
void void
set_is_referenced_by_inline() set_is_referenced_by_inline()
......
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