This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go patch committed: add -fgo-c-header=FILE option


This patch to the Go frontend adds a new option -fgo-c-header=FILE
that tells the Go frontend to create a C header file defining the
package scope constants and struct types.  This is a step toward
converting much of the runtime package from C to Go, in order to use
the new facilities in the master Go library, such as the concurrent
garbage collectors.  By having the Go compiler define these structs
and constants in C, we can ensure that the Go code and the C code are
operating on the same data structures during the transition from C to
Go.

This patch also adds a new option -fcompiling-runtime, to be used when
compiling the runtime package, although that option doesn't do
anything yet.

Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

Ian


2016-08-29  Ian Lance Taylor  <iant@google.com>

* 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.

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]