2015-05-22 Robert Dewar <dewar@adacore.com>
[official-gcc.git] / gcc / config / darwin-c.c
blob3803e75fb76494b144f6d2912b384fcc3e8755d1
1 /* Darwin support needed only by C/C++ frontends.
2 Copyright (C) 2001-2015 Free Software Foundation, Inc.
3 Contributed by Apple Computer Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 #include "config.h"
22 #include "system.h"
23 #include "coretypes.h"
24 #include "tm.h"
25 #include "cpplib.h"
26 #include "hash-set.h"
27 #include "machmode.h"
28 #include "vec.h"
29 #include "double-int.h"
30 #include "input.h"
31 #include "alias.h"
32 #include "symtab.h"
33 #include "wide-int.h"
34 #include "inchash.h"
35 #include "tree.h"
36 #include "target.h"
37 #include "incpath.h"
38 #include "c-family/c-common.h"
39 #include "c-family/c-pragma.h"
40 #include "c-family/c-format.h"
41 #include "diagnostic-core.h"
42 #include "flags.h"
43 #include "tm_p.h"
44 #include "cppdefault.h"
45 #include "prefix.h"
46 #include "c-family/c-target.h"
47 #include "c-family/c-target-def.h"
48 #include "predict.h"
49 #include "dominance.h"
50 #include "cfg.h"
51 #include "cfgrtl.h"
52 #include "cfganal.h"
53 #include "lcm.h"
54 #include "cfgbuild.h"
55 #include "cfgcleanup.h"
56 #include "basic-block.h"
57 #include "hash-map.h"
58 #include "is-a.h"
59 #include "plugin-api.h"
60 #include "vec.h"
61 #include "hashtab.h"
62 #include "hash-set.h"
63 #include "machmode.h"
64 #include "hard-reg-set.h"
65 #include "input.h"
66 #include "function.h"
67 #include "ipa-ref.h"
68 #include "cgraph.h"
69 #include "../../libcpp/internal.h"
71 /* Pragmas. */
73 #define BAD(gmsgid) do { warning (OPT_Wpragmas, gmsgid); return; } while (0)
74 #define BAD2(msgid, arg) do { warning (OPT_Wpragmas, msgid, arg); return; } while (0)
76 static bool using_frameworks = false;
78 static const char *find_subframework_header (cpp_reader *pfile, const char *header,
79 cpp_dir **dirp);
81 typedef struct align_stack
83 int alignment;
84 struct align_stack * prev;
85 } align_stack;
87 static struct align_stack * field_align_stack = NULL;
89 /* Maintain a small stack of alignments. This is similar to pragma
90 pack's stack, but simpler. */
92 static void
93 push_field_alignment (int bit_alignment)
95 align_stack *entry = XNEW (align_stack);
97 entry->alignment = maximum_field_alignment;
98 entry->prev = field_align_stack;
99 field_align_stack = entry;
101 maximum_field_alignment = bit_alignment;
104 static void
105 pop_field_alignment (void)
107 if (field_align_stack)
109 align_stack *entry = field_align_stack;
111 maximum_field_alignment = entry->alignment;
112 field_align_stack = entry->prev;
113 free (entry);
115 else
116 error ("too many #pragma options align=reset");
119 /* Handlers for Darwin-specific pragmas. */
121 void
122 darwin_pragma_ignore (cpp_reader *pfile ATTRIBUTE_UNUSED)
124 /* Do nothing. */
127 /* #pragma options align={mac68k|power|reset} */
129 void
130 darwin_pragma_options (cpp_reader *pfile ATTRIBUTE_UNUSED)
132 const char *arg;
133 tree t, x;
135 if (pragma_lex (&t) != CPP_NAME)
136 BAD ("malformed '#pragma options', ignoring");
137 arg = IDENTIFIER_POINTER (t);
138 if (strcmp (arg, "align"))
139 BAD ("malformed '#pragma options', ignoring");
140 if (pragma_lex (&t) != CPP_EQ)
141 BAD ("malformed '#pragma options', ignoring");
142 if (pragma_lex (&t) != CPP_NAME)
143 BAD ("malformed '#pragma options', ignoring");
145 if (pragma_lex (&x) != CPP_EOF)
146 warning (OPT_Wpragmas, "junk at end of '#pragma options'");
148 arg = IDENTIFIER_POINTER (t);
149 if (!strcmp (arg, "mac68k"))
150 push_field_alignment (16);
151 else if (!strcmp (arg, "power"))
152 push_field_alignment (0);
153 else if (!strcmp (arg, "reset"))
154 pop_field_alignment ();
155 else
156 BAD ("malformed '#pragma options align={mac68k|power|reset}', ignoring");
159 /* #pragma unused ([var {, var}*]) */
161 void
162 darwin_pragma_unused (cpp_reader *pfile ATTRIBUTE_UNUSED)
164 tree decl, x;
165 int tok;
167 if (pragma_lex (&x) != CPP_OPEN_PAREN)
168 BAD ("missing '(' after '#pragma unused', ignoring");
170 while (1)
172 tok = pragma_lex (&decl);
173 if (tok == CPP_NAME && decl)
175 tree local = lookup_name (decl);
176 if (local && (TREE_CODE (local) == PARM_DECL
177 || TREE_CODE (local) == VAR_DECL))
179 TREE_USED (local) = 1;
180 DECL_READ_P (local) = 1;
182 tok = pragma_lex (&x);
183 if (tok != CPP_COMMA)
184 break;
188 if (tok != CPP_CLOSE_PAREN)
189 BAD ("missing ')' after '#pragma unused', ignoring");
191 if (pragma_lex (&x) != CPP_EOF)
192 BAD ("junk at end of '#pragma unused'");
195 /* Parse the ms_struct pragma. */
196 void
197 darwin_pragma_ms_struct (cpp_reader *pfile ATTRIBUTE_UNUSED)
199 const char *arg;
200 tree t;
202 if (pragma_lex (&t) != CPP_NAME)
203 BAD ("malformed '#pragma ms_struct', ignoring");
204 arg = IDENTIFIER_POINTER (t);
206 if (!strcmp (arg, "on"))
207 darwin_ms_struct = true;
208 else if (!strcmp (arg, "off") || !strcmp (arg, "reset"))
209 darwin_ms_struct = false;
210 else
211 BAD ("malformed '#pragma ms_struct {on|off|reset}', ignoring");
213 if (pragma_lex (&t) != CPP_EOF)
214 BAD ("junk at end of '#pragma ms_struct'");
217 static struct frameworks_in_use {
218 size_t len;
219 const char *name;
220 cpp_dir* dir;
221 } *frameworks_in_use;
222 static int num_frameworks = 0;
223 static int max_frameworks = 0;
226 /* Remember which frameworks have been seen, so that we can ensure
227 that all uses of that framework come from the same framework. DIR
228 is the place where the named framework NAME, which is of length
229 LEN, was found. We copy the directory name from NAME, as it will be
230 freed by others. */
232 static void
233 add_framework (const char *name, size_t len, cpp_dir *dir)
235 char *dir_name;
236 int i;
237 for (i = 0; i < num_frameworks; ++i)
239 if (len == frameworks_in_use[i].len
240 && strncmp (name, frameworks_in_use[i].name, len) == 0)
242 return;
245 if (i >= max_frameworks)
247 max_frameworks = i*2;
248 max_frameworks += i == 0;
249 frameworks_in_use = XRESIZEVEC (struct frameworks_in_use,
250 frameworks_in_use, max_frameworks);
252 dir_name = XNEWVEC (char, len + 1);
253 memcpy (dir_name, name, len);
254 dir_name[len] = '\0';
255 frameworks_in_use[num_frameworks].name = dir_name;
256 frameworks_in_use[num_frameworks].len = len;
257 frameworks_in_use[num_frameworks].dir = dir;
258 ++num_frameworks;
261 /* Recall if we have seen the named framework NAME, before, and where
262 we saw it. NAME is LEN bytes long. The return value is the place
263 where it was seen before. */
265 static struct cpp_dir*
266 find_framework (const char *name, size_t len)
268 int i;
269 for (i = 0; i < num_frameworks; ++i)
271 if (len == frameworks_in_use[i].len
272 && strncmp (name, frameworks_in_use[i].name, len) == 0)
274 return frameworks_in_use[i].dir;
277 return 0;
280 /* There are two directories in a framework that contain header files,
281 Headers and PrivateHeaders. We search Headers first as it is more
282 common to upgrade a header from PrivateHeaders to Headers and when
283 that is done, the old one might hang around and be out of data,
284 causing grief. */
286 struct framework_header {const char * dirName; int dirNameLen; };
287 static struct framework_header framework_header_dirs[] = {
288 { "Headers", 7 },
289 { "PrivateHeaders", 14 },
290 { NULL, 0 }
293 /* Returns a pointer to a malloced string that contains the real pathname
294 to the file, given the base name and the name. */
296 static char *
297 framework_construct_pathname (const char *fname, cpp_dir *dir)
299 const char *buf;
300 size_t fname_len, frname_len;
301 cpp_dir *fast_dir;
302 char *frname;
303 struct stat st;
304 int i;
306 /* Framework names must have a / in them. */
307 buf = strchr (fname, '/');
308 if (buf)
309 fname_len = buf - fname;
310 else
311 return 0;
313 fast_dir = find_framework (fname, fname_len);
315 /* Framework includes must all come from one framework. */
316 if (fast_dir && dir != fast_dir)
317 return 0;
319 frname = XNEWVEC (char, strlen (fname) + dir->len + 2
320 + strlen(".framework/") + strlen("PrivateHeaders"));
321 strncpy (&frname[0], dir->name, dir->len);
322 frname_len = dir->len;
323 if (frname_len && frname[frname_len-1] != '/')
324 frname[frname_len++] = '/';
325 strncpy (&frname[frname_len], fname, fname_len);
326 frname_len += fname_len;
327 strncpy (&frname[frname_len], ".framework/", strlen (".framework/"));
328 frname_len += strlen (".framework/");
330 if (fast_dir == 0)
332 frname[frname_len-1] = 0;
333 if (stat (frname, &st) == 0)
335 /* As soon as we find the first instance of the framework,
336 we stop and never use any later instance of that
337 framework. */
338 add_framework (fname, fname_len, dir);
340 else
342 /* If we can't find the parent directory, no point looking
343 further. */
344 free (frname);
345 return 0;
347 frname[frname_len-1] = '/';
350 /* Append framework_header_dirs and header file name */
351 for (i = 0; framework_header_dirs[i].dirName; i++)
353 strncpy (&frname[frname_len],
354 framework_header_dirs[i].dirName,
355 framework_header_dirs[i].dirNameLen);
356 strcpy (&frname[frname_len + framework_header_dirs[i].dirNameLen],
357 &fname[fname_len]);
359 if (stat (frname, &st) == 0)
360 return frname;
363 free (frname);
364 return 0;
367 /* Search for FNAME in sub-frameworks. pname is the context that we
368 wish to search in. Return the path the file was found at,
369 otherwise return 0. */
371 static const char*
372 find_subframework_file (const char *fname, const char *pname)
374 char *sfrname;
375 const char *dot_framework = ".framework/";
376 const char *bufptr;
377 int sfrname_len, i, fname_len;
378 struct cpp_dir *fast_dir;
379 static struct cpp_dir subframe_dir;
380 struct stat st;
382 bufptr = strchr (fname, '/');
384 /* Subframework files must have / in the name. */
385 if (bufptr == 0)
386 return 0;
388 fname_len = bufptr - fname;
389 fast_dir = find_framework (fname, fname_len);
391 /* Sub framework header filename includes parent framework name and
392 header name in the "CarbonCore/OSUtils.h" form. If it does not
393 include slash it is not a sub framework include. */
394 bufptr = strstr (pname, dot_framework);
396 /* If the parent header is not of any framework, then this header
397 cannot be part of any subframework. */
398 if (!bufptr)
399 return 0;
401 /* Now translate. For example, +- bufptr
402 fname = CarbonCore/OSUtils.h |
403 pname = /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h
404 into
405 sfrname = /System/Library/Frameworks/Foundation.framework/Frameworks/CarbonCore.framework/Headers/OSUtils.h */
407 sfrname = XNEWVEC (char, strlen (pname) + strlen (fname) + 2 +
408 strlen ("Frameworks/") + strlen (".framework/")
409 + strlen ("PrivateHeaders"));
411 bufptr += strlen (dot_framework);
413 sfrname_len = bufptr - pname;
415 strncpy (&sfrname[0], pname, sfrname_len);
417 strncpy (&sfrname[sfrname_len], "Frameworks/", strlen ("Frameworks/"));
418 sfrname_len += strlen("Frameworks/");
420 strncpy (&sfrname[sfrname_len], fname, fname_len);
421 sfrname_len += fname_len;
423 strncpy (&sfrname[sfrname_len], ".framework/", strlen (".framework/"));
424 sfrname_len += strlen (".framework/");
426 /* Append framework_header_dirs and header file name */
427 for (i = 0; framework_header_dirs[i].dirName; i++)
429 strncpy (&sfrname[sfrname_len],
430 framework_header_dirs[i].dirName,
431 framework_header_dirs[i].dirNameLen);
432 strcpy (&sfrname[sfrname_len + framework_header_dirs[i].dirNameLen],
433 &fname[fname_len]);
435 if (stat (sfrname, &st) == 0)
437 if (fast_dir != &subframe_dir)
439 if (fast_dir)
440 warning (0, "subframework include %s conflicts with framework include",
441 fname);
442 else
443 add_framework (fname, fname_len, &subframe_dir);
446 return sfrname;
449 free (sfrname);
451 return 0;
454 /* Add PATH to the system includes. PATH must be malloc-ed and
455 NUL-terminated. System framework paths are C++ aware. */
457 static void
458 add_system_framework_path (char *path)
460 int cxx_aware = 1;
461 cpp_dir *p;
463 p = XNEW (cpp_dir);
464 p->next = NULL;
465 p->name = path;
466 p->sysp = 1 + !cxx_aware;
467 p->construct = framework_construct_pathname;
468 using_frameworks = 1;
470 add_cpp_dir_path (p, SYSTEM);
473 /* Add PATH to the bracket includes. PATH must be malloc-ed and
474 NUL-terminated. */
476 void
477 add_framework_path (char *path)
479 cpp_dir *p;
481 p = XNEW (cpp_dir);
482 p->next = NULL;
483 p->name = path;
484 p->sysp = 0;
485 p->construct = framework_construct_pathname;
486 using_frameworks = 1;
488 add_cpp_dir_path (p, BRACKET);
491 static const char *framework_defaults [] =
493 "/System/Library/Frameworks",
494 "/Library/Frameworks",
497 /* Register the GNU objective-C runtime include path if STDINC. */
499 void
500 darwin_register_objc_includes (const char *sysroot, const char *iprefix,
501 int stdinc)
503 const char *fname;
504 size_t len;
505 /* We do not do anything if we do not want the standard includes. */
506 if (!stdinc)
507 return;
509 fname = GCC_INCLUDE_DIR "-gnu-runtime";
511 /* Register the GNU OBJC runtime include path if we are compiling OBJC
512 with GNU-runtime. */
514 if (c_dialect_objc () && !flag_next_runtime)
516 char *str;
517 /* See if our directory starts with the standard prefix.
518 "Translate" them, i.e. replace /usr/local/lib/gcc... with
519 IPREFIX and search them first. */
520 if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0 && !sysroot
521 && !strncmp (fname, cpp_GCC_INCLUDE_DIR, len))
523 str = concat (iprefix, fname + len, NULL);
524 /* FIXME: wrap the headers for C++awareness. */
525 add_path (str, SYSTEM, /*c++aware=*/false, false);
528 /* Should this directory start with the sysroot? */
529 if (sysroot)
530 str = concat (sysroot, fname, NULL);
531 else
532 str = update_path (fname, "");
534 add_path (str, SYSTEM, /*c++aware=*/false, false);
539 /* Register all the system framework paths if STDINC is true and setup
540 the missing_header callback for subframework searching if any
541 frameworks had been registered. */
543 void
544 darwin_register_frameworks (const char *sysroot,
545 const char *iprefix ATTRIBUTE_UNUSED, int stdinc)
547 if (stdinc)
549 size_t i;
551 /* Setup default search path for frameworks. */
552 for (i=0; i<sizeof (framework_defaults)/sizeof(const char *); ++i)
554 char *str;
555 if (sysroot)
556 str = concat (sysroot, xstrdup (framework_defaults [i]), NULL);
557 else
558 str = xstrdup (framework_defaults[i]);
559 /* System Framework headers are cxx aware. */
560 add_system_framework_path (str);
564 if (using_frameworks)
565 cpp_get_callbacks (parse_in)->missing_header = find_subframework_header;
568 /* Search for HEADER in context dependent way. The return value is
569 the malloced name of a header to try and open, if any, or NULL
570 otherwise. This is called after normal header lookup processing
571 fails to find a header. We search each file in the include stack,
572 using FUNC, starting from the most deeply nested include and
573 finishing with the main input file. We stop searching when FUNC
574 returns nonzero. */
576 static const char*
577 find_subframework_header (cpp_reader *pfile, const char *header, cpp_dir **dirp)
579 const char *fname = header;
580 struct cpp_buffer *b;
581 const char *n;
583 for (b = cpp_get_buffer (pfile);
584 b && cpp_get_file (b) && cpp_get_path (cpp_get_file (b));
585 b = cpp_get_prev (b))
587 n = find_subframework_file (fname, cpp_get_path (cpp_get_file (b)));
588 if (n)
590 /* Logically, the place where we found the subframework is
591 the place where we found the Framework that contains the
592 subframework. This is useful for tracking wether or not
593 we are in a system header. */
594 *dirp = cpp_get_dir (cpp_get_file (b));
595 return n;
599 return 0;
602 /* Return the value of darwin_macosx_version_min suitable for the
603 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ macro, so '10.4.2'
604 becomes 1040 and '10.10.0' becomes 101000. The lowest digit is
605 always zero, as is the second lowest for '10.10.x' and above.
606 Print a warning if the version number can't be understood. */
607 static const char *
608 version_as_macro (void)
610 static char result[7] = "1000";
611 int minorDigitIdx;
613 if (strncmp (darwin_macosx_version_min, "10.", 3) != 0)
614 goto fail;
615 if (! ISDIGIT (darwin_macosx_version_min[3]))
616 goto fail;
618 minorDigitIdx = 3;
619 result[2] = darwin_macosx_version_min[minorDigitIdx++];
620 if (ISDIGIT (darwin_macosx_version_min[minorDigitIdx]))
622 /* Starting with OS X 10.10, the macro ends '00' rather than '0',
623 i.e. 10.10.x becomes 101000 rather than 10100. */
624 result[3] = darwin_macosx_version_min[minorDigitIdx++];
625 result[4] = '0';
626 result[5] = '0';
627 result[6] = '\0';
629 if (darwin_macosx_version_min[minorDigitIdx] != '\0'
630 && darwin_macosx_version_min[minorDigitIdx] != '.')
631 goto fail;
633 return result;
635 fail:
636 error ("unknown value %qs of -mmacosx-version-min",
637 darwin_macosx_version_min);
638 return "1000";
641 /* Define additional CPP flags for Darwin. */
643 #define builtin_define(TXT) cpp_define (pfile, TXT)
645 void
646 darwin_cpp_builtins (cpp_reader *pfile)
648 builtin_define ("__MACH__");
649 builtin_define ("__APPLE__");
651 /* __APPLE_CC__ is defined as some old Apple include files expect it
652 to be defined and won't work if it isn't. */
653 builtin_define_with_value ("__APPLE_CC__", "1", false);
655 if (darwin_constant_cfstrings)
656 builtin_define ("__CONSTANT_CFSTRINGS__");
658 builtin_define_with_value ("__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__",
659 version_as_macro(), false);
661 /* Since we do not (at 4.6) support ObjC gc for the NeXT runtime, the
662 following will cause a syntax error if one tries to compile gc attributed
663 items. However, without this, NeXT system headers cannot be parsed
664 properly (on systems >= darwin 9). */
665 if (flag_objc_gc)
667 builtin_define ("__strong=__attribute__((objc_gc(strong)))");
668 builtin_define ("__weak=__attribute__((objc_gc(weak)))");
669 builtin_define ("__OBJC_GC__");
671 else
673 builtin_define ("__strong=");
674 builtin_define ("__weak=");
677 if (CPP_OPTION (pfile, objc) && flag_objc_abi == 2)
678 builtin_define ("__OBJC2__");
681 /* Handle C family front-end options. */
683 static bool
684 handle_c_option (size_t code,
685 const char *arg,
686 int value ATTRIBUTE_UNUSED)
688 switch (code)
690 default:
691 /* Unrecognized options that we said we'd handle turn into
692 errors if not listed here. */
693 return false;
695 case OPT_iframework:
696 add_system_framework_path (xstrdup (arg));
697 break;
699 case OPT_fapple_kext:
703 /* We recognized the option. */
704 return true;
707 /* Allow ObjC* access to CFStrings. */
708 static tree
709 darwin_objc_construct_string (tree str)
711 if (!darwin_constant_cfstrings)
713 /* Even though we are not using CFStrings, place our literal
714 into the cfstring_htab hash table, so that the
715 darwin_constant_cfstring_p() function will see it. */
716 darwin_enter_string_into_cfstring_table (str);
717 /* Fall back to NSConstantString. */
718 return NULL_TREE;
721 return darwin_build_constant_cfstring (str);
724 /* The string ref type is created as CFStringRef by <CFBase.h> therefore, we
725 must match for it explicitly, since it's outside the gcc code. */
727 static bool
728 darwin_cfstring_ref_p (const_tree strp)
730 tree tn;
731 if (!strp || TREE_CODE (strp) != POINTER_TYPE)
732 return false;
734 tn = TYPE_NAME (strp);
735 if (tn)
736 tn = DECL_NAME (tn);
737 return (tn
738 && IDENTIFIER_POINTER (tn)
739 && !strncmp (IDENTIFIER_POINTER (tn), "CFStringRef", 8));
742 /* At present the behavior of this is undefined and it does nothing. */
743 static void
744 darwin_check_cfstring_format_arg (tree ARG_UNUSED (format_arg),
745 tree ARG_UNUSED (args_list))
749 /* The extra format types we recognize. */
750 EXPORTED_CONST format_kind_info darwin_additional_format_types[] = {
751 { "CFString", NULL, NULL, NULL, NULL,
752 NULL, NULL,
753 FMT_FLAG_ARG_CONVERT|FMT_FLAG_PARSE_ARG_CONVERT_EXTERNAL, 0, 0, 0, 0, 0, 0,
754 NULL, NULL
759 /* Support routines to dump the class references for NeXT ABI v1, aka
760 32-bits ObjC-2.0, as top-level asms.
761 The following two functions should only be called from
762 objc/objc-next-runtime-abi-01.c. */
764 static void
765 darwin_objc_declare_unresolved_class_reference (const char *name)
767 const char *lazy_reference = ".lazy_reference\t";
768 const char *hard_reference = ".reference\t";
769 const char *reference = MACHOPIC_INDIRECT ? lazy_reference : hard_reference;
770 size_t len = strlen (reference) + strlen(name) + 2;
771 char *buf = (char *) alloca (len);
773 gcc_checking_assert (!strncmp (name, ".objc_class_name_", 17));
775 snprintf (buf, len, "%s%s", reference, name);
776 symtab->finalize_toplevel_asm (build_string (strlen (buf), buf));
779 static void
780 darwin_objc_declare_class_definition (const char *name)
782 const char *xname = targetm.strip_name_encoding (name);
783 size_t len = strlen (xname) + 7 + 5;
784 char *buf = (char *) alloca (len);
786 gcc_checking_assert (!strncmp (name, ".objc_class_name_", 17)
787 || !strncmp (name, "*.objc_category_name_", 21));
789 /* Mimic default_globalize_label. */
790 snprintf (buf, len, ".globl\t%s", xname);
791 symtab->finalize_toplevel_asm (build_string (strlen (buf), buf));
793 snprintf (buf, len, "%s = 0", xname);
794 symtab->finalize_toplevel_asm (build_string (strlen (buf), buf));
797 #undef TARGET_HANDLE_C_OPTION
798 #define TARGET_HANDLE_C_OPTION handle_c_option
800 #undef TARGET_OBJC_CONSTRUCT_STRING_OBJECT
801 #define TARGET_OBJC_CONSTRUCT_STRING_OBJECT darwin_objc_construct_string
803 #undef TARGET_OBJC_DECLARE_UNRESOLVED_CLASS_REFERENCE
804 #define TARGET_OBJC_DECLARE_UNRESOLVED_CLASS_REFERENCE \
805 darwin_objc_declare_unresolved_class_reference
807 #undef TARGET_OBJC_DECLARE_CLASS_DEFINITION
808 #define TARGET_OBJC_DECLARE_CLASS_DEFINITION \
809 darwin_objc_declare_class_definition
811 #undef TARGET_STRING_OBJECT_REF_TYPE_P
812 #define TARGET_STRING_OBJECT_REF_TYPE_P darwin_cfstring_ref_p
814 #undef TARGET_CHECK_STRING_OBJECT_FORMAT_ARG
815 #define TARGET_CHECK_STRING_OBJECT_FORMAT_ARG darwin_check_cfstring_format_arg
817 struct gcc_targetcm targetcm = TARGETCM_INITIALIZER;