]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000: Darwin builtin support
authorBill Schmidt <wschmidt@linux.ibm.com>
Fri, 5 Mar 2021 01:54:00 +0000 (19:54 -0600)
committerBill Schmidt <wschmidt@linux.ibm.com>
Mon, 30 Aug 2021 19:58:25 +0000 (14:58 -0500)
2021-03-04  Bill Schmidt  <wschmidt@linux.ibm.com>

gcc/
* config/rs6000/darwin.h (SUBTARGET_INIT_BUILTINS): Use the new
decl when new_builtins_are_live.
* config/rs6000/rs6000-builtin-new.def (__builtin_cfstring): New
built-in.

gcc/config/rs6000/darwin.h
gcc/config/rs6000/rs6000-builtin-new.def

index 42f39e60305713ddaf97d52cb8fdb66524546cd3..6abf8e84f547da80fc3ce6733688b07de954548e 100644 (file)
 #define SUBTARGET_INIT_BUILTINS                                                \
 do {                                                                   \
   darwin_patch_builtins ();                                            \
-  rs6000_builtin_decls[(unsigned) (RS6000_BUILTIN_CFSTRING)]           \
-    = darwin_init_cfstring_builtins ((unsigned) (RS6000_BUILTIN_CFSTRING)); \
+  if (new_builtins_are_live)                                           \
+    rs6000_builtin_decls_x[(unsigned) (RS6000_BIF_CFSTRING)]           \
+      = darwin_init_cfstring_builtins ((unsigned) (RS6000_BIF_CFSTRING)); \
+  else                                                                 \
+    rs6000_builtin_decls[(unsigned) (RS6000_BUILTIN_CFSTRING)]         \
+      = darwin_init_cfstring_builtins ((unsigned) (RS6000_BUILTIN_CFSTRING)); \
 } while(0)
 
 /* So far, there is no rs6000_fold_builtin, if one is introduced, then
index 3e732ce91e46f274d876fedc94bbda225e97d369..6a28d5189f8514095f352ba77b45251c80f07466 100644 (file)
 ; Builtins that have been around since time immemorial or are just
 ; considered available everywhere.
 [always]
+; __builtin_cfstring is for Darwin, which will replace the decl we
+; create here with another one during subtarget processing.  We just
+; need to ensure it has a slot in the builtin enumeration.
+  void __builtin_cfstring ();
+    CFSTRING nothing {}
+
   void __builtin_cpu_init ();
     CPU_INIT nothing {cpu}