comparison gcc/go/go-lang.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* go-lang.c -- Go frontend gcc interface. 1 /* go-lang.c -- Go frontend gcc interface.
2 Copyright (C) 2009-2017 Free Software Foundation, Inc. 2 Copyright (C) 2009-2018 Free Software Foundation, Inc.
3 3
4 This file is part of GCC. 4 This file is part of GCC.
5 5
6 GCC is free software; you can redistribute it and/or modify it under 6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free 7 the terms of the GNU General Public License as published by the Free
37 #include <mpfr.h> 37 #include <mpfr.h>
38 38
39 #include "go-c.h" 39 #include "go-c.h"
40 #include "go-gcc.h" 40 #include "go-gcc.h"
41 41
42 #ifndef TARGET_AIX
43 #define TARGET_AIX 0
44 #endif
45
42 /* Language-dependent contents of a type. */ 46 /* Language-dependent contents of a type. */
43 47
44 struct GTY(()) lang_type 48 struct GTY(()) lang_type
45 { 49 {
46 char dummy; 50 char dummy;
110 args.c_header = go_c_header; 114 args.c_header = go_c_header;
111 args.check_divide_by_zero = go_check_divide_zero; 115 args.check_divide_by_zero = go_check_divide_zero;
112 args.check_divide_overflow = go_check_divide_overflow; 116 args.check_divide_overflow = go_check_divide_overflow;
113 args.compiling_runtime = go_compiling_runtime; 117 args.compiling_runtime = go_compiling_runtime;
114 args.debug_escape_level = go_debug_escape_level; 118 args.debug_escape_level = go_debug_escape_level;
119 args.debug_escape_hash = go_debug_escape_hash;
120 args.nil_check_size_threshold = TARGET_AIX ? -1 : 4096;
115 args.linemap = go_get_linemap(); 121 args.linemap = go_get_linemap();
116 args.backend = go_get_backend(); 122 args.backend = go_get_backend();
117 go_create_gogo (&args); 123 go_create_gogo (&args);
118 124
119 build_common_builtin_nodes (); 125 build_common_builtin_nodes ();
186 192
187 static bool 193 static bool
188 go_langhook_handle_option ( 194 go_langhook_handle_option (
189 size_t scode, 195 size_t scode,
190 const char *arg, 196 const char *arg,
191 int value ATTRIBUTE_UNUSED, 197 HOST_WIDE_INT value,
192 int kind ATTRIBUTE_UNUSED, 198 int kind ATTRIBUTE_UNUSED,
193 location_t loc ATTRIBUTE_UNUSED, 199 location_t loc ATTRIBUTE_UNUSED,
194 const struct cl_option_handlers *handlers ATTRIBUTE_UNUSED) 200 const struct cl_option_handlers *handlers ATTRIBUTE_UNUSED)
195 { 201 {
196 enum opt_code code = (enum opt_code) scode; 202 enum opt_code code = (enum opt_code) scode;
243 case OPT_fgo_dump_: 249 case OPT_fgo_dump_:
244 ret = go_enable_dump (arg) ? true : false; 250 ret = go_enable_dump (arg) ? true : false;
245 break; 251 break;
246 252
247 case OPT_fgo_optimize_: 253 case OPT_fgo_optimize_:
248 ret = go_enable_optimize (arg) ? true : false; 254 ret = go_enable_optimize (arg, value) ? true : false;
249 break; 255 break;
250 256
251 case OPT_fgo_pkgpath_: 257 case OPT_fgo_pkgpath_:
252 go_pkgpath = arg; 258 go_pkgpath = arg;
253 break; 259 break;
370 tree type; 376 tree type;
371 /* Go has no vector types. Build them here. FIXME: It does not 377 /* Go has no vector types. Build them here. FIXME: It does not
372 make sense for the middle-end to ask the frontend for a type 378 make sense for the middle-end to ask the frontend for a type
373 which the frontend does not support. However, at least for now 379 which the frontend does not support. However, at least for now
374 it is required. See PR 46805. */ 380 it is required. See PR 46805. */
375 if (VECTOR_MODE_P (mode)) 381 if (GET_MODE_CLASS (mode) == MODE_VECTOR_BOOL
382 && valid_vector_subparts_p (GET_MODE_NUNITS (mode)))
383 {
384 unsigned int elem_bits = vector_element_size (GET_MODE_BITSIZE (mode),
385 GET_MODE_NUNITS (mode));
386 tree bool_type = build_nonstandard_boolean_type (elem_bits);
387 return build_vector_type_for_mode (bool_type, mode);
388 }
389 else if (VECTOR_MODE_P (mode)
390 && valid_vector_subparts_p (GET_MODE_NUNITS (mode)))
376 { 391 {
377 tree inner; 392 tree inner;
378 393
379 inner = go_langhook_type_for_mode (GET_MODE_INNER (mode), unsignedp); 394 inner = go_langhook_type_for_mode (GET_MODE_INNER (mode), unsignedp);
380 if (inner != NULL_TREE) 395 if (inner != NULL_TREE)