From patchwork Tue Nov 16 21:19:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 71457 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 8DC4AB7131 for ; Wed, 17 Nov 2010 08:22:05 +1100 (EST) Received: (qmail 8120 invoked by alias); 16 Nov 2010 21:21:57 -0000 Received: (qmail 8108 invoked by uid 22791); 16 Nov 2010 21:21:55 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, TW_CC, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 16 Nov 2010 21:19:39 +0000 Received: from wpaz9.hot.corp.google.com (wpaz9.hot.corp.google.com [172.24.198.73]) by smtp-out.google.com with ESMTP id oAGLJb3H030310 for ; Tue, 16 Nov 2010 13:19:37 -0800 Received: from pxi12 (pxi12.prod.google.com [10.243.27.12]) by wpaz9.hot.corp.google.com with ESMTP id oAGLJaHE007524 for ; Tue, 16 Nov 2010 13:19:36 -0800 Received: by pxi12 with SMTP id 12so441026pxi.14 for ; Tue, 16 Nov 2010 13:19:36 -0800 (PST) Received: by 10.142.154.5 with SMTP id b5mr6009524wfe.439.1289942376138; Tue, 16 Nov 2010 13:19:36 -0800 (PST) Received: from coign.google.com (dhcp-172-22-124-185.mtv.corp.google.com [172.22.124.185]) by mx.google.com with ESMTPS id x35sm1851165wfd.13.2010.11.16.13.19.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 16 Nov 2010 13:19:35 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: [gccgo] Use LANG_HOOK_INIT_OPTIONS_STRUCT Date: Tue, 16 Nov 2010 13:19:33 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch changes to Go frontend from LANG_HOOK_INIT_OPTIONS to the newer LANG_HOOK_INIT_OPTIONS_STRUCT. As it happens LANG_HOOK_INIT_OPTIONS is no longer necessary. Committed to gccgo branch. Ian Index: go-lang.c =================================================================== --- go-lang.c (revision 166822) +++ go-lang.c (working copy) @@ -94,7 +94,7 @@ go_langhook_init (void) size_type_node = long_long_unsigned_type_node; else size_type_node = long_unsigned_type_node; - set_sizetype(size_type_node); + set_sizetype (size_type_node); build_common_tree_nodes_2 (0); @@ -110,6 +110,14 @@ go_langhook_init (void) /* I don't know why this is not done by any of the above. */ void_list_node = build_tree_list (NULL_TREE, void_type_node); + /* The default precision for floating point numbers. This is used + for floating point constants with abstract type. This may + eventually be controllable by a command line option. */ + mpfr_set_default_prec (128); + + /* Go uses exceptions. */ + using_eh_for_cleanups (); + return true; } @@ -121,49 +129,37 @@ go_langhook_option_lang_mask (void) return CL_Go; } -/* Initialize before parsing options. */ +/* Initialize the options structure. */ static void -go_langhook_init_options ( - unsigned int argc ATTRIBUTE_UNUSED, - struct cl_decoded_option *decoded_options ATTRIBUTE_UNUSED) +go_langhook_init_options_struct (struct gcc_options *opts) { /* Go says that signed overflow is precisely defined. */ - flag_wrapv = 1; + opts->x_flag_wrapv = 1; /* We default to using strict aliasing, since Go pointers are safe. This is turned off for code that imports the "unsafe" package, because using unsafe.pointer violates C style aliasing requirements. */ - flag_strict_aliasing = 1; + opts->x_flag_strict_aliasing = 1; /* Default to avoiding range issues for complex multiply and divide. */ - flag_complex_method = 2; + opts->x_flag_complex_method = 2; /* The builtin math functions should not set errno. */ - flag_errno_math = 0; + opts->x_flag_errno_math = 0; /* By default assume that floating point math does not trap. */ - flag_trapping_math = 0; - - /* We default to always showing a column number. */ - flag_show_column = 1; - - /* The default precision for floating point numbers. This is used - for floating point constants with abstract type. This may - eventually be controllable by a command line option. */ - mpfr_set_default_prec (128); + opts->x_flag_trapping_math = 0; /* We turn on stack splitting if we can. */ if (targetm.supports_split_stack (false)) - flag_split_stack = 1; + opts->x_flag_split_stack = 1; /* Exceptions are used to handle recovering from panics. */ - flag_exceptions = 1; - flag_non_call_exceptions = 1; - using_eh_for_cleanups (); - + opts->x_flag_exceptions = 1; + opts->x_flag_non_call_exceptions = 1; } /* Handle Go specific options. Return 0 if we didn't do anything. */ @@ -363,7 +359,7 @@ go_preserve_from_gc(tree t) #undef LANG_HOOKS_NAME #undef LANG_HOOKS_INIT #undef LANG_HOOKS_OPTION_LANG_MASK -#undef LANG_HOOKS_INIT_OPTIONS +#undef LANG_HOOKS_INIT_OPTIONS_STRUCT #undef LANG_HOOKS_HANDLE_OPTION #undef LANG_HOOKS_POST_OPTIONS #undef LANG_HOOKS_PARSE_FILE @@ -380,7 +376,7 @@ go_preserve_from_gc(tree t) #define LANG_HOOKS_NAME "GNU Go" #define LANG_HOOKS_INIT go_langhook_init #define LANG_HOOKS_OPTION_LANG_MASK go_langhook_option_lang_mask -#define LANG_HOOKS_INIT_OPTIONS go_langhook_init_options +#define LANG_HOOKS_INIT_OPTIONS_STRUCT go_langhook_init_options_struct #define LANG_HOOKS_HANDLE_OPTION go_langhook_handle_option #define LANG_HOOKS_POST_OPTIONS go_langhook_post_options #define LANG_HOOKS_PARSE_FILE go_langhook_parse_file