aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-lang.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2021-01-04 17:40:11 -0800
committerIan Lance Taylor <iant@golang.org>2021-01-04 17:41:16 -0800
commitbf183413c6f6e745f1324e39586a65a4f9fcea3f (patch)
tree88af7c87a0e550bf34ab1942412ab28b58c26f9e /gcc/go/go-lang.c
parent15af33a88065f983181550fc53821f1c6e14c5c7 (diff)
downloadgcc-bf183413c6f6e745f1324e39586a65a4f9fcea3f.zip
gcc-bf183413c6f6e745f1324e39586a65a4f9fcea3f.tar.gz
gcc-bf183413c6f6e745f1324e39586a65a4f9fcea3f.tar.bz2
Go frontend: add -fgo-embedcfg option
This option will be used by the go command to implement go:embed directives, which are new with the upcoming Go 1.16 release. * lang.opt (fgo-embedcfg): New option. * go-c.h (struct go_create_gogo_args): Add embedcfg field. * go-lang.c (go_embedcfg): New static variable. (go_langhook_init): Set go_create_gogo_args embedcfg field. (go_langhook_handle_option): Handle OPT_fgo_embedcfg_. * gccgo.texi (Invoking gccgo): Document -fgo-embedcfg.
Diffstat (limited to 'gcc/go/go-lang.c')
-rw-r--r--gcc/go/go-lang.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c
index eba40e4..a01db8d 100644
--- a/gcc/go/go-lang.c
+++ b/gcc/go/go-lang.c
@@ -89,6 +89,7 @@ static const char *go_pkgpath = NULL;
static const char *go_prefix = NULL;
static const char *go_relative_import_path = NULL;
static const char *go_c_header = NULL;
+static const char *go_embedcfg = NULL;
/* Language hooks. */
@@ -112,6 +113,7 @@ go_langhook_init (void)
args.prefix = go_prefix;
args.relative_import_path = go_relative_import_path;
args.c_header = go_c_header;
+ args.embedcfg = go_embedcfg;
args.check_divide_by_zero = go_check_divide_zero;
args.check_divide_overflow = go_check_divide_overflow;
args.compiling_runtime = go_compiling_runtime;
@@ -282,6 +284,10 @@ go_langhook_handle_option (
go_c_header = arg;
break;
+ case OPT_fgo_embedcfg_:
+ go_embedcfg = arg;
+ break;
+
default:
/* Just return 1 to indicate that the option is valid. */
break;