diff options
author | Ian Lance Taylor <iant@google.com> | 2016-08-30 03:27:43 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-08-30 03:27:43 +0000 |
commit | 2adb671d186febfe9610f8d8ac8ba296b79d2c90 (patch) | |
tree | 4e9dd1801c8fffce5ca94c71063a0a5a3acd0d30 /gcc/go/go-c.h | |
parent | 0b390d608949864df9ce128a5090b1788dc07b16 (diff) | |
download | gcc-2adb671d186febfe9610f8d8ac8ba296b79d2c90.zip gcc-2adb671d186febfe9610f8d8ac8ba296b79d2c90.tar.gz gcc-2adb671d186febfe9610f8d8ac8ba296b79d2c90.tar.bz2 |
compiler: add -fgo-c-header=FILE to create a C header
The new -fgo-c-header=FILE option will write a C header file defining
all the struct types and numeric const values in package scope. This
will be used when building the Go runtime package (libgo/go/runtime) to
generate a C header file that may be included by the C code in the C
runtime package (libgo/runtime).
This will ensure that the Go code and C code are working with the same
data structures as we convert the runtime from C to Go to upgrade to the
current GC runtime, notably the concurrent garbage collector.
Reviewed-on: https://go-review.googlesource.com/28000
* lang.opt (fgo-c-header, fgo-compiling-runtime): New options.
* go-c.h (struct go_create_gogo_args): Define.
(go_create_gogo): Change declaration to take struct pointer.
* go-lang.c (go_c_header): New static variable.
(go_langhook_init): Update call to go_create_gogo.
* gccgo.texi (Invoking gccgo): Document -fgo-c-header and
-fgo-compiling-runtime.
From-SVN: r239852
Diffstat (limited to 'gcc/go/go-c.h')
-rw-r--r-- | gcc/go/go-c.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/gcc/go/go-c.h b/gcc/go/go-c.h index 690d6db..a96812d 100644 --- a/gcc/go/go-c.h +++ b/gcc/go/go-c.h @@ -31,11 +31,21 @@ extern int go_enable_optimize (const char*); extern void go_add_search_path (const char*); -extern void go_create_gogo (int int_type_size, int pointer_size, - const char* pkgpath, const char *prefix, - const char *relative_import_path, - bool check_divide_zero, bool check_divide_overflow, - int debug_escape_level); +struct go_create_gogo_args +{ + int int_type_size; + int pointer_size; + const char* pkgpath; + const char *prefix; + const char *relative_import_path; + const char *c_header; + bool check_divide_by_zero; + bool check_divide_overflow; + bool compiling_runtime; + int debug_escape_level; +}; + +extern void go_create_gogo (const struct go_create_gogo_args*); extern void go_parse_input_files (const char**, unsigned int, bool only_check_syntax, |