diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-09 21:17:23 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-09 21:17:23 +0000 |
commit | 2a2647e2647e389283327557b3604a4fdb1e703c (patch) | |
tree | 35b68564005a08b6b179869395daba334368b0bc /gcc/go/go-lang.c | |
parent | d834564a753973e8655f45010784562c65f8b340 (diff) | |
download | ppe42-gcc-2a2647e2647e389283327557b3604a4fdb1e703c.tar.gz ppe42-gcc-2a2647e2647e389283327557b3604a4fdb1e703c.zip |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187356 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go/go-lang.c')
-rw-r--r-- | gcc/go/go-lang.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c index 895e39d12e3..f02f769252b 100644 --- a/gcc/go/go-lang.c +++ b/gcc/go/go-lang.c @@ -81,6 +81,11 @@ struct GTY(()) language_function int dummy; }; +/* Option information we need to pass to go_create_gogo. */ + +static const char *go_pkgpath = NULL; +static const char *go_prefix = NULL; + /* Language hooks. */ static bool @@ -96,7 +101,7 @@ go_langhook_init (void) to, e.g., unsigned_char_type_node) but before calling build_common_builtin_nodes (because it calls, indirectly, go_type_for_size). */ - go_create_gogo (INT_TYPE_SIZE, POINTER_SIZE); + go_create_gogo (INT_TYPE_SIZE, POINTER_SIZE, go_pkgpath, go_prefix); build_common_builtin_nodes (); @@ -227,8 +232,12 @@ go_langhook_handle_option ( ret = go_enable_optimize (arg) ? true : false; break; + case OPT_fgo_pkgpath_: + go_pkgpath = arg; + break; + case OPT_fgo_prefix_: - go_set_prefix (arg); + go_prefix = arg; break; default: |