diff options
author | Ian Lance Taylor <iant@google.com> | 2012-05-09 21:17:23 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-05-09 21:17:23 +0000 |
commit | 097b12fb975ba045fffebc2cb1de407d3dba4bbc (patch) | |
tree | 35b68564005a08b6b179869395daba334368b0bc /gcc/go/gofrontend/parse.cc | |
parent | 1b8b126f386ffff12b02f7c9cb2a00c38996f1ea (diff) | |
download | gcc-097b12fb975ba045fffebc2cb1de407d3dba4bbc.zip gcc-097b12fb975ba045fffebc2cb1de407d3dba4bbc.tar.gz gcc-097b12fb975ba045fffebc2cb1de407d3dba4bbc.tar.bz2 |
compiler: Add -fgo-pkgpath option.
* lang.opt: Add -fgo-pkgpath.
* go-lang.c (go_pkgpath): New static variable.
(go_prefix): New static variable.
(go_langhook_init): Pass go_pkgpath and go_prefix to
go_create_gogo.
(go_langhook_handle_option): Handle -fgo-pkgpath. Change
-fgo-prefix handling to just set go_prefix.
* go-c.h (go_set_prefix): Don't declare.
(go_create_gogo): Add pkgpath and prefix to declaration.
* go-gcc.cc (Gcc_backend::global_variable): Change unique_prefix
to pkgpath. Don't include the package name in the asm name.
* gccgo.texi (Invoking gccgo): Document -fgo-pkgpath. Update the
docs for -fgo-prefix.
From-SVN: r187356
Diffstat (limited to 'gcc/go/gofrontend/parse.cc')
-rw-r--r-- | gcc/go/gofrontend/parse.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index fc2c229..29323f0 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -323,13 +323,13 @@ Parse::type_name(bool issue_error) && package->name() != this->gogo_->package_name()) { // Check whether the name is there but hidden. - std::string s = ('.' + package->package_value()->unique_prefix() - + '.' + package->package_value()->name() + std::string s = ('.' + package->package_value()->pkgpath() + '.' + name); named_object = package->package_value()->lookup(s); if (named_object != NULL) { - const std::string& packname(package->package_value()->name()); + Package* p = package->package_value(); + const std::string& packname(p->package_name()); error_at(location, "invalid reference to hidden type %<%s.%s%>", Gogo::message_name(packname).c_str(), Gogo::message_name(name).c_str()); @@ -345,7 +345,7 @@ Parse::type_name(bool issue_error) named_object = this->gogo_->add_unknown_name(name, location); else { - const std::string& packname(package->package_value()->name()); + const std::string& packname(package->package_value()->package_name()); error_at(location, "reference to undefined identifier %<%s.%s%>", Gogo::message_name(packname).c_str(), Gogo::message_name(name).c_str()); @@ -2384,7 +2384,7 @@ Parse::operand(bool may_be_sink) { go_assert(package != NULL); error_at(location, "invalid reference to hidden type %<%s.%s%>", - Gogo::message_name(package->name()).c_str(), + Gogo::message_name(package->package_name()).c_str(), Gogo::message_name(id).c_str()); return Expression::make_error(location); } @@ -2394,7 +2394,7 @@ Parse::operand(bool may_be_sink) { if (package != NULL) { - std::string n1 = Gogo::message_name(package->name()); + std::string n1 = Gogo::message_name(package->package_name()); std::string n2 = Gogo::message_name(id); if (!is_exported) error_at(location, |