This patch to the Go frontend shows readable names in the messages
printed for escape analysis. This will print names like `x` instead
of `.p.x`. Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.
Committed to mainline.
Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE (revision 257069)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-897ce971b06a39c217d02dce9e1361bc7a240188
+13b25c25faa8afd625732d2630a4f9ece5cacb2e
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Index: gcc/go/gofrontend/escape.cc
===================================================================
--- gcc/go/gofrontend/escape.cc (revision 257033)
+++ gcc/go/gofrontend/escape.cc (working copy)
@@ -131,7 +131,7 @@ Node::ast_format(Gogo* gogo) const
Named_object* no = this->object();
if (no->is_function() && no->func_value()->enclosing() != NULL)
return "func literal";
- ss << no->name();
+ ss << no->message_name();
}
else if (this->expr() != NULL)
{
Index: gcc/go/gofrontend/expressions.cc
===================================================================
--- gcc/go/gofrontend/expressions.cc (revision 257033)
+++ gcc/go/gofrontend/expressions.cc (working copy)
@@ -783,7 +783,7 @@ Var_expression::do_get_backend(Translate
void
Var_expression::do_dump_expression(Ast_dump_context* ast_dump_context) const
{
- ast_dump_context->ostream() << this->variable_->name() ;
+ ast_dump_context->ostream() << this->variable_->message_name() ;
}
// Make a reference to a variable in an expression.
@@ -859,7 +859,7 @@ Enclosed_var_expression::do_address_take
void
Enclosed_var_expression::do_dump_expression(Ast_dump_context* adc) const
{
- adc->ostream() << this->variable_->name();
+ adc->ostream() << this->variable_->message_name();
}
// Make a reference to a variable within an enclosing function.
Index: gcc/go/gofrontend/wb.cc
===================================================================
--- gcc/go/gofrontend/wb.cc (revision 256820)
+++ gcc/go/gofrontend/wb.cc (working copy)
@@ -151,7 +151,7 @@ Check_escape::variable(Named_object* no)
&& no->result_var_value()->is_in_heap()))
go_error_at(no->location(),
"%s escapes to heap, not allowed in runtime",
- no->name().c_str());
+ no->message_name().c_str());
return TRAVERSE_CONTINUE;
}