diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-12 20:29:15 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-12 20:29:15 +0000 |
commit | ffa607ae3b5d0af94871857cd0fbbaf671159aa7 (patch) | |
tree | b123a9dad3c5421e8200b57f7a379cf06011320c /gcc/go/gofrontend/gogo.cc | |
parent | f54bd5c2a2060da2105eb4043d8ff030dc84a29c (diff) | |
download | gcc-ffa607ae3b5d0af94871857cd0fbbaf671159aa7.tar.gz |
escape: Add escape notes to export data.
Reviewed-on: https://go-review.googlesource.com/22375
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238266 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go/gofrontend/gogo.cc')
-rw-r--r-- | gcc/go/gofrontend/gogo.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc index e373d8b17b7..37760a75e6c 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -4794,6 +4794,7 @@ Function::export_func_with_type(Export* exp, const std::string& name, exp->write_c_string("("); const Typed_identifier* receiver = fntype->receiver(); exp->write_name(receiver->name()); + exp->write_escape(receiver->note()); exp->write_c_string(" "); exp->write_type(receiver->type()); exp->write_c_string(") "); @@ -4817,6 +4818,7 @@ Function::export_func_with_type(Export* exp, const std::string& name, else exp->write_c_string(", "); exp->write_name(p->name()); + exp->write_escape(p->note()); exp->write_c_string(" "); if (!is_varargs || p + 1 != parameters->end()) exp->write_type(p->type()); @@ -4850,6 +4852,7 @@ Function::export_func_with_type(Export* exp, const std::string& name, else exp->write_c_string(", "); exp->write_name(p->name()); + exp->write_escape(p->note()); exp->write_c_string(" "); exp->write_type(p->type()); } @@ -4875,9 +4878,11 @@ Function::import_func(Import* imp, std::string* pname, { imp->require_c_string("("); std::string name = imp->read_name(); + std::string escape_note = imp->read_escape(); imp->require_c_string(" "); Type* rtype = imp->read_type(); *preceiver = new Typed_identifier(name, rtype, imp->location()); + (*preceiver)->set_note(escape_note); imp->require_c_string(") "); } @@ -4894,6 +4899,7 @@ Function::import_func(Import* imp, std::string* pname, while (true) { std::string name = imp->read_name(); + std::string escape_note = imp->read_escape(); imp->require_c_string(" "); if (imp->match_c_string("...")) @@ -4905,8 +4911,9 @@ Function::import_func(Import* imp, std::string* pname, Type* ptype = imp->read_type(); if (*is_varargs) ptype = Type::make_array_type(ptype, NULL); - parameters->push_back(Typed_identifier(name, ptype, - imp->location())); + Typed_identifier t = Typed_identifier(name, ptype, imp->location()); + t.set_note(escape_note); + parameters->push_back(t); if (imp->peek_char() != ',') break; go_assert(!*is_varargs); @@ -4934,10 +4941,13 @@ Function::import_func(Import* imp, std::string* pname, while (true) { std::string name = imp->read_name(); + std::string note = imp->read_escape(); imp->require_c_string(" "); Type* rtype = imp->read_type(); - results->push_back(Typed_identifier(name, rtype, - imp->location())); + Typed_identifier t = Typed_identifier(name, rtype, + imp->location()); + t.set_note(note); + results->push_back(t); if (imp->peek_char() != ',') break; imp->require_c_string(", "); |