diff mbox

[gccgo] Update for merge with gcc mainline

Message ID mcrlj681k1s.fsf@google.com
State New
Headers show

Commit Message

Ian Lance Taylor Oct. 8, 2010, 8:55 p.m. UTC
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 mbox

Patch

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"