compiler: show readable names in escape analysis messages
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 26 Jan 2018 23:58:54 +0000 (23:58 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 26 Jan 2018 23:58:54 +0000 (23:58 +0000)
    Call message_name when printing a variable for an escape analysis
    message.  This implies changing the AST dumps, which is fine.

    Reviewed-on: https://go-review.googlesource.com/90296

From-SVN: r257113

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/escape.cc
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/wb.cc

index 25801a67cd8748c839f50ee4a6dc706ee6f3edb4..2a6e183eeaf6ccf9ecd9671f4339737679479dc0 100644 (file)
@@ -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 e15e85f3082c05d4fae25ecd136cd85973c4e831..873c187bb573aa1ea6bffec0d0b4cb6182697b2f 100644 (file)
@@ -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 0701cb045187f1aedbd786616aac39809c14d764..534b61fc6f036e2eb38729ae9895034602cbac30 100644 (file)
@@ -783,7 +783,7 @@ Var_expression::do_get_backend(Translate_context* context)
 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_taken(bool escapes)
 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 fb3ef4d59020270c1556ffb92b46e3e00bb63bd0..c550c52d5e5462c10c7a57b377f2cca5014d1dd4 100644 (file)
@@ -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;
 }