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/export.h | |
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/export.h')
-rw-r--r-- | gcc/go/gofrontend/export.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/export.h b/gcc/go/gofrontend/export.h index 0e03f48..c6a4810 100644 --- a/gcc/go/gofrontend/export.h +++ b/gcc/go/gofrontend/export.h @@ -117,7 +117,7 @@ class Export : public String_dump // Export the identifiers in BINDINGS which are marked for export. // The exporting is done via a series of calls to THIS->STREAM_. If // is nothing to export, this->stream_->write will not be called. - // UNIQUE_PREFIX is a prefix for all global symbols. + // PKGPATH is the package path. // PACKAGE_PRIORITY is the priority to use for this package. // IMPORT_INIT_FN is the name of the import initialization function // for this package; it will be empty if none is needed. @@ -125,7 +125,7 @@ class Export : public String_dump // imported packages. void export_globals(const std::string& package_name, - const std::string& unique_prefix, + const std::string& pkgpath, int package_priority, const std::map<std::string, Package*>& imports, const std::string& import_init_fn, @@ -182,6 +182,8 @@ class Export : public String_dump Type_refs type_refs_; // Index number of next type. int type_index_; + // Packages we have written out. + Unordered_set(const Package*) packages_; }; // An export streamer which puts the export stream in a named section. |