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/go-gcc.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/go-gcc.cc')
-rw-r--r-- | gcc/go/go-gcc.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc index 08950b8..4729a3b 100644 --- a/gcc/go/go-gcc.cc +++ b/gcc/go/go-gcc.cc @@ -271,7 +271,7 @@ class Gcc_backend : public Backend Bvariable* global_variable(const std::string& package_name, - const std::string& unique_prefix, + const std::string& pkgpath, const std::string& name, Btype* btype, bool is_external, @@ -1281,7 +1281,7 @@ Gcc_backend::non_zero_size_type(tree type) Bvariable* Gcc_backend::global_variable(const std::string& package_name, - const std::string& unique_prefix, + const std::string& pkgpath, const std::string& name, Btype* btype, bool is_external, @@ -1310,9 +1310,9 @@ Gcc_backend::global_variable(const std::string& package_name, { TREE_PUBLIC(decl) = 1; - std::string asm_name(unique_prefix); + std::string asm_name(pkgpath); asm_name.push_back('.'); - asm_name.append(var_name); + asm_name.append(name); SET_DECL_ASSEMBLER_NAME(decl, get_identifier_from_string(asm_name)); } TREE_USED(decl) = 1; |