@@ -1596,7 +1596,8 @@ Func_descriptor_expression::do_get_backend(Translate_context* context)
15961596 return context->backend()->var_expression(this->dvar_, loc);
15971597
15981598 Gogo* gogo = context->gogo();
1599- std::string var_name(gogo->function_descriptor_name(no));
1599+ Backend_name bname;
1600+ gogo->function_descriptor_backend_name(no, &bname);
16001601 bool is_descriptor = false;
16011602 if (no->is_function_declaration()
16021603 && !no->func_declaration_value()->asm_name().empty()
@@ -1616,10 +1617,11 @@ Func_descriptor_expression::do_get_backend(Translate_context* context)
16161617 Btype* btype = this->type()->get_backend(gogo);
16171618
16181619 Bvariable* bvar;
1619- std::string asm_name(go_selectively_encode_id(var_name));
16201620 if (no->package() != NULL || is_descriptor)
1621- bvar = context->backend()->immutable_struct_reference(var_name, asm_name,
1622- btype, loc);
1621+ bvar =
1622+ context->backend()->immutable_struct_reference(bname.name(),
1623+ bname.optional_asm_name(),
1624+ btype, loc);
16231625 else
16241626 {
16251627 Location bloc = Linemap::predeclared_location();
@@ -1644,7 +1646,8 @@ Func_descriptor_expression::do_get_backend(Translate_context* context)
16441646 if (no->is_function() && no->func_value()->is_referenced_by_inline())
16451647 is_hidden = false;
16461648
1647- bvar = context->backend()->immutable_struct(var_name, asm_name,
1649+ bvar = context->backend()->immutable_struct(bname.name(),
1650+ bname.optional_asm_name(),
16481651 is_hidden, false,
16491652 btype, bloc);
16501653 Expression_list* vals = new Expression_list();
@@ -1654,8 +1657,9 @@ Func_descriptor_expression::do_get_backend(Translate_context* context)
16541657 Translate_context bcontext(gogo, NULL, NULL, NULL);
16551658 bcontext.set_is_const();
16561659 Bexpression* binit = init->get_backend(&bcontext);
1657- context->backend()->immutable_struct_set_init(bvar, var_name, is_hidden,
1658- false, btype, bloc, binit);
1660+ context->backend()->immutable_struct_set_init(bvar, bname.name(),
1661+ is_hidden, false, btype,
1662+ bloc, binit);
16591663 }
16601664
16611665 this->dvar_ = bvar;
@@ -5190,11 +5194,9 @@ Unary_expression::do_get_backend(Translate_context* context)
51905194 copy_to_heap = (context->function() != NULL
51915195 || context->is_const());
51925196 }
5193- std::string asm_name(go_selectively_encode_id(var_name));
51945197 Bvariable* implicit =
5195- gogo->backend()->implicit_variable(var_name, asm_name,
5196- btype, true, copy_to_heap,
5197- false, 0);
5198+ gogo->backend()->implicit_variable(var_name, "", btype, true,
5199+ copy_to_heap, false, 0);
51985200 gogo->backend()->implicit_variable_set_init(implicit, var_name, btype,
51995201 true, copy_to_heap, false,
52005202 bexpr);
@@ -5219,20 +5221,18 @@ Unary_expression::do_get_backend(Translate_context* context)
52195221 && this->expr_->is_static_initializer())
52205222 {
52215223 std::string var_name(gogo->initializer_name());
5222- std::string asm_name(go_selectively_encode_id(var_name));
52235224 Bvariable* decl =
5224- gogo->backend()->immutable_struct(var_name, asm_name ,
5225- true, false, btype, loc);
5225+ gogo->backend()->immutable_struct(var_name, "", true, false ,
5226+ btype, loc);
52265227 gogo->backend()->immutable_struct_set_init(decl, var_name, true,
52275228 false, btype, loc, bexpr);
52285229 bexpr = gogo->backend()->var_expression(decl, loc);
52295230 }
52305231 else if (this->expr_->is_constant())
52315232 {
52325233 std::string var_name(gogo->initializer_name());
5233- std::string asm_name(go_selectively_encode_id(var_name));
52345234 Bvariable* decl =
5235- gogo->backend()->implicit_variable(var_name, asm_name , btype,
5235+ gogo->backend()->implicit_variable(var_name, "" , btype,
52365236 true, true, false, 0);
52375237 gogo->backend()->implicit_variable_set_init(decl, var_name, btype,
52385238 true, true, false,
@@ -18251,9 +18251,8 @@ Interface_mtable_expression::do_get_backend(Translate_context* context)
1825118251 {
1825218252 // The interface conversion table is defined elsewhere.
1825318253 Btype* btype = this->type()->get_backend(gogo);
18254- std::string asm_name(go_selectively_encode_id(mangled_name));
1825518254 this->bvar_ =
18256- gogo->backend()->immutable_struct_reference(mangled_name, asm_name ,
18255+ gogo->backend()->immutable_struct_reference(mangled_name, "" ,
1825718256 btype, loc);
1825818257 return gogo->backend()->var_expression(this->bvar_, this->location());
1825918258 }
@@ -18323,8 +18322,7 @@ Interface_mtable_expression::do_get_backend(Translate_context* context)
1832318322 Bexpression* ctor =
1832418323 gogo->backend()->constructor_expression(btype, ctor_bexprs, loc);
1832518324
18326- std::string asm_name(go_selectively_encode_id(mangled_name));
18327- this->bvar_ = gogo->backend()->immutable_struct(mangled_name, asm_name, false,
18325+ this->bvar_ = gogo->backend()->immutable_struct(mangled_name, "", false,
1832818326 !is_public, btype, loc);
1832918327 gogo->backend()->immutable_struct_set_init(this->bvar_, mangled_name, false,
1833018328 !is_public, btype, loc, ctor);
0 commit comments