diff options
author | Ian Lance Taylor <iant@google.com> | 2012-10-02 23:50:23 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2012-10-02 23:50:23 +0000 |
commit | 1c6372e46179538995667c41a426dee6613fbbcc (patch) | |
tree | a92ae57e783518fc65dba6ca3e6248f49c8536c8 /gcc/go | |
parent | 0c4af930dc07cc1133f0ec674b13e1002b734e1f (diff) |
compiler: Fix a couple of type reflection strings.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@192014 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go')
-rw-r--r-- | gcc/go/gofrontend/types.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index 3ae54a43806..1736a32654d 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -4919,14 +4919,15 @@ Struct_type::write_equal_function(Gogo* gogo, Named_type* name) void Struct_type::do_reflection(Gogo* gogo, std::string* ret) const { - ret->append("struct { "); + ret->append("struct {"); for (Struct_field_list::const_iterator p = this->fields_->begin(); p != this->fields_->end(); ++p) { if (p != this->fields_->begin()) - ret->append("; "); + ret->push_back(';'); + ret->push_back(' '); if (p->is_anonymous()) ret->push_back('?'); else @@ -4959,7 +4960,10 @@ Struct_type::do_reflection(Gogo* gogo, std::string* ret) const } } - ret->append(" }"); + if (!this->fields_->empty()) + ret->push_back(' '); + + ret->push_back('}'); } // Mangled name. @@ -8390,6 +8394,7 @@ Named_type::do_reflection(Gogo* gogo, std::string* ret) const } if (this->in_function_ != NULL) { + ret->push_back('\t'); ret->append(Gogo::unpack_hidden_name(this->in_function_->name())); ret->push_back('$'); if (this->in_function_index_ > 0) @@ -8399,6 +8404,7 @@ Named_type::do_reflection(Gogo* gogo, std::string* ret) const ret->append(buf); ret->push_back('$'); } + ret->push_back('\t'); } ret->append(Gogo::unpack_hidden_name(this->named_object_->name())); } |