From patchwork Fri Oct 8 20:55:27 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: 67288 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 64C79B70D4 for ; Sat, 9 Oct 2010 07:55:47 +1100 (EST) Received: (qmail 6114 invoked by alias); 8 Oct 2010 20:55:43 -0000 Received: (qmail 6095 invoked by uid 22791); 8 Oct 2010 20:55:41 -0000 X-SWARE-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL, BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, TW_CC, TW_RG, 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; Fri, 08 Oct 2010 20:55:36 +0000 Received: from hpaq6.eem.corp.google.com (hpaq6.eem.corp.google.com [172.25.149.6]) by smtp-out.google.com with ESMTP id o98KtXnc010240 for ; Fri, 8 Oct 2010 13:55:34 -0700 Received: from pwi8 (pwi8.prod.google.com [10.241.219.8]) by hpaq6.eem.corp.google.com with ESMTP id o98KtV9C021363 for ; Fri, 8 Oct 2010 13:55:32 -0700 Received: by pwi8 with SMTP id 8so504224pwi.13 for ; Fri, 08 Oct 2010 13:55:31 -0700 (PDT) Received: by 10.142.218.2 with SMTP id q2mr2489019wfg.167.1286571331378; Fri, 08 Oct 2010 13:55:31 -0700 (PDT) Received: from coign.google.com (adsl-71-133-8-30.dsl.pltn13.pacbell.net [71.133.8.30]) by mx.google.com with ESMTPS id x8sm4133952wff.11.2010.10.08.13.55.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 08 Oct 2010 13:55:30 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: [gccgo] Update for merge with gcc mainline Date: Fri, 08 Oct 2010 13:55:27 -0700 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 consists of some miscellaneous changes in preparation for the merge with gcc mainline, mostly in the area of option handling. I also rebuilt the libgo configure script. Committed to gccgo branch. Ian diff -r baf91e7fd5dc go/Make-lang.in --- a/go/Make-lang.in Fri Oct 08 13:50:54 2010 -0700 +++ b/go/Make-lang.in Fri Oct 08 13:53:21 2010 -0700 @@ -28,7 +28,8 @@ .PHONY: go -gospec.o: $(srcdir)/go/gospec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) $(CONFIG_H) +gospec.o: $(srcdir)/go/gospec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) \ + $(CONFIG_H) opts.h (SHLIB_LINK='$(SHLIB_LINK)'; \ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \ $(INCLUDES) $(srcdir)/go/gospec.c) @@ -126,7 +127,7 @@ -mv go/*$(objext) stagefeedback/go GO_SYSTEM_H = go/go-system.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - toplev.h input.h + $(DIAGNOSTIC_CORE_H) $(INPUT_H) GO_C_H = go/go-c.h $(MACHMODE_H) GO_LEX_H = go/lex.h go/operator.h @@ -145,19 +146,19 @@ go/export.o: go/export.cc $(GO_SYSTEM_H) $(srcdir)/../include/sha1.h \ $(MACHMODE_H) output.h $(TARGET_H) $(GO_GOGO_H) $(GO_TYPES_H) \ $(GO_STATEMENTS_H) go/export.h -go/expressions.o: go/expressions.cc $(GO_SYSTEM_H) intl.h $(TREE_H) \ - $(GIMPLE_H) tree-iterator.h convert.h $(REAL_H) $(TM_P_H) \ - $(GO_C_H) $(GO_GOGO_H) $(GO_TYPES_H) go/export.h $(GO_IMPORT_H) \ - $(GO_STATEMENTS_H) $(GO_LEX_H) $(GO_EXPRESSIONS_H) +go/expressions.o: go/expressions.cc $(GO_SYSTEM_H) $(TOPLEV_H) intl.h \ + $(TREE_H) $(GIMPLE_H) tree-iterator.h convert.h $(REAL_H) realmpfr.h \ + $(TM_P_H) $(GO_C_H) $(GO_GOGO_H) $(GO_TYPES_H) go/export.h \ + $(GO_IMPORT_H) $(GO_STATEMENTS_H) $(GO_LEX_H) $(GO_EXPRESSIONS_H) go/go.o: go/go.cc $(GO_SYSTEM_H) $(GO_C_H) $(GO_LEX_H) $(GO_PARSE_H) \ $(GO_GOGO_H) go/go-dump.o: go/go-dump.cc $(GO_SYSTEM_H) $(GO_C_H) go/go-dump.h go/go-lang.o: go/go-lang.c $(GO_SYSTEM_H) coretypes.h opts.h $(TREE_H) \ - $(GIMPLE_H) $(GGC_H) toplev.h debug.h options.h $(FLAGS_H) convert.h \ - langhooks.h langhooks-def.h $(EXCEPT_H) $(TARGET_H) $(DIAGNOSTIC_H) \ - $(GO_C_H) gt-go-go-lang.h gtype-go.h -go/gogo-tree.o: go/gogo-tree.cc $(GO_SYSTEM_H) $(TREE_H) $(GIMPLE_H) \ - tree-iterator.h $(CGRAPH_H) langhooks.h convert.h output.h \ + $(GIMPLE_H) $(GGC_H) $(TOPLEV_H) debug.h options.h $(FLAGS_H) \ + convert.h langhooks.h $(LANGHOOKS_DEF_H) $(EXCEPT_H) $(TARGET_H) \ + $(DIAGNOSTIC_H) $(GO_C_H) gt-go-go-lang.h gtype-go.h +go/gogo-tree.o: go/gogo-tree.cc $(GO_SYSTEM_H) $(TOPLEV_H) $(TREE_H) \ + $(GIMPLE_H) tree-iterator.h $(CGRAPH_H) langhooks.h convert.h output.h \ $(TM_P_H) $(DIAGNOSTIC_H) $(RTL_H) $(GO_TYPES_H) $(GO_EXPRESSIONS_H) \ $(GO_STATEMENTS_H) $(GO_GOGO_H) go/gogo.o: go/gogo.cc $(GO_SYSTEM_H) go/go-dump.h $(GO_LEX_H) $(GO_TYPES_H) \ @@ -175,8 +176,8 @@ $(GIMPLE_H) convert.h tree-iterator.h $(TREE_FLOW_H) $(REAL_H) \ $(GO_C_H) $(GO_TYPES_H) $(GO_EXPRESSIONS_H) $(GO_GOGO_H) \ $(GO_STATEMENTS_H) -go/types.o: go/types.cc $(GO_SYSTEM_H) intl.h $(TREE_H) $(GIMPLE_H) \ - $(REAL_H) convert.h $(GO_C_H) $(GO_GOGO_H) go/operator.h \ +go/types.o: go/types.cc $(GO_SYSTEM_H) $(TOPLEV_H) intl.h $(TREE_H) \ + $(GIMPLE_H) $(REAL_H) convert.h $(GO_C_H) $(GO_GOGO_H) go/operator.h \ $(GO_EXPRESSIONS_H) $(GO_STATEMENTS_H) go/export.h $(GO_IMPORT_H) \ $(GO_TYPES_H) go/unsafe.o: go/unsafe.cc $(GO_SYSTEM_H) $(GO_TYPES_H) $(GO_GOGO_H) diff -r baf91e7fd5dc go/go-lang.c --- a/go/go-lang.c Fri Oct 08 13:50:54 2010 -0700 +++ b/go/go-lang.c Fri Oct 08 13:53:21 2010 -0700 @@ -72,7 +72,7 @@ static bool go_langhook_init (void) { - build_common_tree_nodes (false, false); + build_common_tree_nodes (false); /* The sizetype may be "unsigned long" or "unsigned long long". */ if (TYPE_MODE (long_unsigned_type_node) == ptr_mode) @@ -100,11 +100,20 @@ return true; } +/* The option mask. */ + +static unsigned int +go_langhook_option_lang_mask (void) +{ + return CL_Go; +} + /* Initialize before parsing options. */ -static unsigned int -go_langhook_init_options (unsigned int argc ATTRIBUTE_UNUSED, - const char** argv ATTRIBUTE_UNUSED) +static void +go_langhook_init_options ( + unsigned int argc ATTRIBUTE_UNUSED, + struct cl_decoded_option *decoded_options ATTRIBUTE_UNUSED) { /* Go says that signed overflow is precisely defined. */ flag_wrapv = 1; @@ -142,17 +151,20 @@ flag_non_call_exceptions = 1; using_eh_for_cleanups (); - return CL_Go; } /* Handle Go specific options. Return 0 if we didn't do anything. */ -static int -go_langhook_handle_option (size_t scode, const char *arg, - int value ATTRIBUTE_UNUSED) +static bool +go_langhook_handle_option ( + size_t scode, + const char *arg, + int value ATTRIBUTE_UNUSED, + int kind ATTRIBUTE_UNUSED, + const struct cl_option_handlers *handlers ATTRIBUTE_UNUSED) { enum opt_code code = (enum opt_code) scode; - int ret = 1; + bool ret = true; switch (code) { @@ -165,7 +177,7 @@ break; case OPT_fgo_dump_: - ret = go_enable_dump (arg); + ret = go_enable_dump (arg) ? true : false; break; case OPT_fgo_prefix_: @@ -280,7 +292,7 @@ static tree personality_decl; if (personality_decl == NULL_TREE) { - const char* name = (USING_SJLJ_EXCEPTIONS + const char* name = (targetm.except_unwind_info () == UI_SJLJ ? "__gccgo_personality_sj0" : "__gccgo_personality_v0"); personality_decl = build_personality_function (name); @@ -338,6 +350,7 @@ #undef LANG_HOOKS_NAME #undef LANG_HOOKS_INIT +#undef LANG_HOOKS_OPTION_LANG_MASK #undef LANG_HOOKS_INIT_OPTIONS #undef LANG_HOOKS_HANDLE_OPTION #undef LANG_HOOKS_POST_OPTIONS @@ -354,6 +367,7 @@ #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_HANDLE_OPTION go_langhook_handle_option #define LANG_HOOKS_POST_OPTIONS go_langhook_post_options diff -r baf91e7fd5dc go/go-system.h --- a/go/go-system.h Fri Oct 08 13:50:54 2010 -0700 +++ b/go/go-system.h Fri Oct 08 13:53:21 2010 -0700 @@ -37,7 +37,7 @@ #include "coretypes.h" #include "tm.h" -#include "toplev.h" +#include "diagnostic-core.h" #include "input.h" } // End extern "C"