summaryrefslogtreecommitdiff
path: root/gcc/config/darwin-c.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-06 11:08:17 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-06 11:08:17 +0000
commitc94b1d0eb368245668287fc40c9d24ef26e16a34 (patch)
tree8e4c7045bc87ed3ed6e71d6b4f137a6be8e21970 /gcc/config/darwin-c.c
parentcd800728c05c142bde2035f188967bc42d6caa32 (diff)
downloadgcc-c94b1d0eb368245668287fc40c9d24ef26e16a34.tar.gz
* doc/tm.texi.in: Document C target hooks as separate from general
target hooks. * doc/tm.texi: Regenerate. * genhooks.c (struct hook_desc): Add docname field. (HOOK_VECTOR_1, DEFHOOKPOD, DEFHOOK, DEFHOOK_UNDOC). Initialize docname field. (hook_array): Include c-target.def. (emit_documentation): Use docname field in output. (emit_init_macros): Take docname argument. Only emit definitions for hooks matching docname. (main): Expect additional arguments in all cases. Pass argument to emit_init_macros. * target.def: Move initial macro definitions and comments to target-hooks-macros.h. (gcc_targetcm): Move to c-family/c-target.def. * target.h (targetcm): Move declaration to c-family/c-target.h. * targhooks.c (default_handle_c_option): Move to c-family/c-opts.c. * targhooks.h (default_handle_c_option): Move declaration to c-family/c-common.h. * target-hooks-macros.h: New file. * config.gcc (target_has_targetcm): Define and use to add to c_target_objs and cxx_target_objs. * config/default-c.c: New file. * config/darwin-c.c: Include c-target.h and c-target-def.h instead of target.h and target-def.h. (TARGET_HANDLE_C_OPTION, targetcm): Define later in file. (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Make static. (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG): Define here. * config/darwin-protos.h (darwin_objc_construct_string, darwin_cfstring_ref_p, darwin_check_cfstring_format_arg): Don't declare. * config/darwin.h (TARGET_OBJC_CONSTRUCT_STRING_OBJECT, TARGET_STRING_OBJECT_REF_TYPE_P, TARGET_CHECK_STRING_OBJECT_FORMAT_ARG, TARGET_HAS_TARGETCM): Remove. * config/t-darwin (darwin-c.o): Update dependencies. * system.h (TARGET_HAS_TARGETCM): Poison. * Makefile.in (TARGET_H): Update. (TARGET_DEF, C_TARGET_DEF, C_TARGET_H, C_TARGET_DEF_H): Define. (c-family/c-format.o, c-family/c-opts.o): Update dependencies. (default-c.o): New target. (s-target-hooks-def-h): Pass "Target Hook" string to genhooks. (c-family/c-target-hooks-def.h, s-c-target-hooks-def-h): New targets. (s-tm-texi): Pass -d option to genhooks. Also test timestamp on c-target.def. (build/genhooks.o): Update dependencies. c-family: * c-target-def.h: New file. * c-target.def: New file. * c-target.h: New file. * c-common.c (targetcm): Don't define here. * c-common.h (default_handle_c_option): Declare. * c-format.c: Include c-target.h instead of target.h. * c-opts.c: Include c-target.h instead of target.h. Explicitly include tm.h. (default_handle_c_option): Move from targhooks.c. objc: * objc-act.c: Include c-target.h instead of target.h. * Make-lang.in (objc/objc-act.o): Update dependencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172035 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/darwin-c.c')
-rw-r--r--gcc/config/darwin-c.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c
index 0c713ba7e85..08de2f8ef6c 100644
--- a/gcc/config/darwin-c.c
+++ b/gcc/config/darwin-c.c
@@ -1,5 +1,5 @@
/* Darwin support needed only by C/C++ frontends.
- Copyright (C) 2001, 2003, 2004, 2005, 2007, 2008, 2010
+ Copyright (C) 2001, 2003, 2004, 2005, 2007, 2008, 2010, 2011
Free Software Foundation, Inc.
Contributed by Apple Computer Inc.
@@ -34,8 +34,8 @@ along with GCC; see the file COPYING3. If not see
#include "tm_p.h"
#include "cppdefault.h"
#include "prefix.h"
-#include "target.h"
-#include "target-def.h"
+#include "c-family/c-target.h"
+#include "c-family/c-target-def.h"
/* Pragmas. */
@@ -660,13 +660,8 @@ handle_c_option (size_t code,
return true;
}
-#undef TARGET_HANDLE_C_OPTION
-#define TARGET_HANDLE_C_OPTION handle_c_option
-
-struct gcc_targetcm targetcm = TARGETCM_INITIALIZER;
-
/* Allow ObjC* access to CFStrings. */
-tree
+static tree
darwin_objc_construct_string (tree str)
{
if (!darwin_constant_cfstrings)
@@ -685,7 +680,7 @@ darwin_objc_construct_string (tree str)
/* The string ref type is created as CFStringRef by <CFBase.h> therefore, we
must match for it explicitly, since it's outside the gcc code. */
-bool
+static bool
darwin_cfstring_ref_p (const_tree strp)
{
tree tn;
@@ -701,7 +696,7 @@ darwin_cfstring_ref_p (const_tree strp)
}
/* At present the behavior of this is undefined and it does nothing. */
-void
+static void
darwin_check_cfstring_format_arg (tree ARG_UNUSED (format_arg),
tree ARG_UNUSED (args_list))
{
@@ -715,3 +710,17 @@ EXPORTED_CONST format_kind_info darwin_additional_format_types[] = {
NULL, NULL
}
};
+
+#undef TARGET_HANDLE_C_OPTION
+#define TARGET_HANDLE_C_OPTION handle_c_option
+
+#undef TARGET_OBJC_CONSTRUCT_STRING_OBJECT
+#define TARGET_OBJC_CONSTRUCT_STRING_OBJECT darwin_objc_construct_string
+
+#undef TARGET_STRING_OBJECT_REF_TYPE_P
+#define TARGET_STRING_OBJECT_REF_TYPE_P darwin_cfstring_ref_p
+
+#undef TARGET_CHECK_STRING_OBJECT_FORMAT_ARG
+#define TARGET_CHECK_STRING_OBJECT_FORMAT_ARG darwin_check_cfstring_format_arg
+
+struct gcc_targetcm targetcm = TARGETCM_INITIALIZER;