diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-05-02 14:43:35 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-05-02 14:43:35 +0000 |
commit | 34efdaf078b01a7387007c4e6bde6db86384c4b7 (patch) | |
tree | d503eaf41d085669d1481bb46ec038bc866fece6 /gcc/go/go-lang.c | |
parent | f733cf303bcdc952c92b81dd62199a40a1f555ec (diff) | |
download | gcc-tarball-master.tar.gz |
gcc-7.1.0gcc-7.1.0
Diffstat (limited to 'gcc/go/go-lang.c')
-rw-r--r-- | gcc/go/go-lang.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c index 9c95c8e0bb..780d73799e 100644 --- a/gcc/go/go-lang.c +++ b/gcc/go/go-lang.c @@ -1,5 +1,5 @@ /* go-lang.c -- Go frontend gcc interface. - Copyright (C) 2009-2016 Free Software Foundation, Inc. + Copyright (C) 2009-2017 Free Software Foundation, Inc. This file is part of GCC. @@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see #include <mpfr.h> #include "go-c.h" +#include "go-gcc.h" /* Language-dependent contents of a type. */ @@ -83,6 +84,7 @@ struct GTY(()) language_function 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; /* Language hooks. */ @@ -99,9 +101,20 @@ 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_pkgpath, go_prefix, - go_relative_import_path, go_check_divide_zero, - go_check_divide_overflow); + struct go_create_gogo_args args; + args.int_type_size = INT_TYPE_SIZE; + args.pointer_size = POINTER_SIZE; + args.pkgpath = go_pkgpath; + args.prefix = go_prefix; + args.relative_import_path = go_relative_import_path; + args.c_header = go_c_header; + args.check_divide_by_zero = go_check_divide_zero; + args.check_divide_overflow = go_check_divide_overflow; + args.compiling_runtime = go_compiling_runtime; + args.debug_escape_level = go_debug_escape_level; + args.linemap = go_get_linemap(); + args.backend = go_get_backend(); + go_create_gogo (&args); build_common_builtin_nodes (); @@ -247,6 +260,10 @@ go_langhook_handle_option ( go_relative_import_path = arg; break; + case OPT_fgo_c_header_: + go_c_header = arg; + break; + default: /* Just return 1 to indicate that the option is valid. */ break; @@ -356,10 +373,9 @@ go_langhook_type_for_mode (machine_mode mode, int unsignedp) return NULL_TREE; } - // FIXME: This static_cast should be in machmode.h. - enum mode_class mc = static_cast<enum mode_class>(GET_MODE_CLASS(mode)); + enum mode_class mc = GET_MODE_CLASS (mode); if (mc == MODE_INT) - return go_langhook_type_for_size(GET_MODE_BITSIZE(mode), unsignedp); + return go_langhook_type_for_size (GET_MODE_BITSIZE (mode), unsignedp); else if (mc == MODE_FLOAT) { switch (GET_MODE_BITSIZE (mode)) |