Commits

Iain Buclaw committed 6e7de62

Fold in more patches for Apple GCC (thanks Anders)

Comments (0)

Files changed (6)

 {
     // As of 4.3.x, this is done by add_builtin_function
     //%% for D, just use library_name?
-    tree decl = d_build_decl (FUNCTION_DECL, get_identifier (name), type);
+    tree decl = d_build_decl42 (FUNCTION_DECL, get_identifier (name), type);
     DECL_EXTERNAL (decl) = 1;
     TREE_PUBLIC (decl) = 1;
     if (library_name)
 extern tree d_type_promotes_to(tree);
 
 extern rtx d_expand_expr(tree, rtx, enum machine_mode, int, rtx *);
-extern tree d_build_decl(tree_code code, tree name, tree type, location_t loc = 0);
+extern tree d_build_decl(tree_code code, tree name, tree type, location_t loc = input_location);
 
 extern void gcc_d_backend_init();
 extern void gcc_d_backend_term();
 d_build_decl(tree_code code, tree name, tree type, location_t loc)
 {
     tree t;
-    if (!loc)
-    {   // Prefer input location if location is unknown.
-        loc = input_location;
-    }
 #if D_GCC_VER >= 45
     t = build_decl(loc, code, name, type);
 #else
     t = build_decl(code, name, type);
-#if D_USE_MAPPED_LOCATION
+#ifdef D_USE_MAPPED_LOCATION
     DECL_SOURCE_LOCATION(t) = loc;
 #endif
 #endif
     return t;
 }
 
+tree
+d_build_decl42(tree_code code, tree name, tree type)
+{
+    return d_build_decl(code, name, type);
+}
+
 bool
 d_mark_addressable (tree t)
 {
 extern tree d_type_promotes_to(tree);
 
 extern rtx d_expand_expr(tree, rtx, enum machine_mode, int, rtx *);
-extern tree d_build_decl(tree_code code, tree name, tree type, location_t loc = 0);
+extern tree d_build_decl(tree_code code, tree name, tree type, location_t loc = input_location);
 
 extern void gcc_d_backend_init();
 extern void gcc_d_backend_term();
 tree d_signed_type(tree);
 tree d_type_for_size(unsigned bits, int unsignedp);
 tree d_type_for_mode(enum machine_mode mode, int unsignedp);
+tree d_build_decl42(enum tree_code code, tree name, tree type);
 void dkeep(tree t);
 
 /* In d-builtins.c */
 void
 ObjectFile::finish()
 {
-#if D_GCC_VER < 43
+#if D_GCC_VER < 43 && !(defined(__APPLE__) && D_GCC_VER == 42)
 #define D_FFN_I 'I'
 #define D_FFN_D 'D'
 #else

d/patches/patch-apple-gcc-5664

      to the calling program.  */
   static int pass_exit_codes;
 ***************
+*** 367,372 ****
+--- 367,375 ----
+  static const char *replace_outfile_spec_function (int, const char **);
+  static const char *version_compare_spec_function (int, const char **);
+  static const char *include_spec_function (int, const char **);
++ 
++ extern const char *d_all_sources_spec_function (int, const char **);
++ extern const char *d_output_prefix_spec_function (int, const char **);
+  
+  /* The Specs Language
+  
+***************
 *** 473,478 ****
 --- 476,482 ----
   	assembler has done its job.
   
   struct compiler
 ***************
+*** 1656,1661 ****
+--- 1659,1668 ----
+    { "replace-outfile",		replace_outfile_spec_function },
+    { "version-compare",		version_compare_spec_function },
+    { "include",			include_spec_function },
++ #ifdef D_USE_EXTRA_SPEC_FUNCTIONS
++   { "d-all-sources",		d_all_sources_spec_function },
++   { "d-output-prefix",		d_output_prefix_spec_function },
++ #endif
+  #ifdef EXTRA_SPEC_FUNCTIONS
+    EXTRA_SPEC_FUNCTIONS
+  #endif
+***************
 *** 4095,4100 ****
 --- 4101,4109 ----
   	}