aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2011-04-06 12:08:17 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2011-04-06 12:08:17 +0100
commitacce4e77382b198a70f1044724bda19b01997657 (patch)
tree8e4c7045bc87ed3ed6e71d6b4f137a6be8e21970 /gcc/doc
parent275b4baa7103f181bf0d7a7e3b97497d6b678ce6 (diff)
downloadgcc-acce4e77382b198a70f1044724bda19b01997657.zip
gcc-acce4e77382b198a70f1044724bda19b01997657.tar.gz
gcc-acce4e77382b198a70f1044724bda19b01997657.tar.bz2
tm.texi.in: Document C target hooks as separate from general target hooks.
* 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. From-SVN: r172035
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/tm.texi16
-rw-r--r--gcc/doc/tm.texi.in8
2 files changed, 20 insertions, 4 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index e036a75..e5938fe 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -91,6 +91,14 @@ form part of the @code{targetm} structure, it is documented below as a
from being defined in the @file{.h} file to being part of the
@code{targetm} structure.
+Similarly, there is a @code{targetcm} variable for hooks that are
+specific to front ends for C-family languages, documented as ``C
+Target Hook''. This is declared in @file{c-family/c-target.h}, the
+the initializer @code{TARGETCM_INITIALIZER} in
+@file{c-family/c-target-def.h}. If targets initialize @code{targetcm}
+themselves, they should set @code{target_has_targetcm=yes} in
+@file{config.gcc}; otherwise a default definition is used.
+
@node Driver
@section Controlling the Compilation Driver, @file{gcc}
@cindex driver
@@ -678,7 +686,7 @@ option was passed (@code{UNKNOWN_LOCATION} except for options passed
via attributes).
@end deftypefn
-@deftypefn {Target Hook} bool TARGET_HANDLE_C_OPTION (size_t @var{code}, const char *@var{arg}, int @var{value})
+@deftypefn {C Target Hook} bool TARGET_HANDLE_C_OPTION (size_t @var{code}, const char *@var{arg}, int @var{value})
This target hook is called whenever the user specifies one of the
target-specific C language family options described by the @file{.opt}
definition files(@pxref{Options}). It has the opportunity to do some
@@ -692,15 +700,15 @@ only available in the C (and related language) front ends, then you
should use @code{TARGET_HANDLE_C_OPTION} instead.
@end deftypefn
-@deftypefn {Target Hook} tree TARGET_OBJC_CONSTRUCT_STRING_OBJECT (tree @var{string})
+@deftypefn {C Target Hook} tree TARGET_OBJC_CONSTRUCT_STRING_OBJECT (tree @var{string})
Targets may provide a string object type that can be used within and between C, C++ and their respective Objective-C dialects. A string object might, for example, embed encoding and length information. These objects are considered opaque to the compiler and handled as references. An ideal implementation makes the composition of the string object match that of the Objective-C @code{NSString} (@code{NXString} for GNUStep), allowing efficient interworking between C-only and Objective-C code. If a target implements string objects then this hook should return a reference to such an object constructed from the normal `C' string representation provided in @var{string}. At present, the hook is used by Objective-C only, to obtain a common-format string object when the target provides one.
@end deftypefn
-@deftypefn {Target Hook} bool TARGET_STRING_OBJECT_REF_TYPE_P (const_tree @var{stringref})
+@deftypefn {C Target Hook} bool TARGET_STRING_OBJECT_REF_TYPE_P (const_tree @var{stringref})
If a target implements string objects then this hook should return @code{true} if @var{stringref} is a valid reference to such an object.
@end deftypefn
-@deftypefn {Target Hook} void TARGET_CHECK_STRING_OBJECT_FORMAT_ARG (tree @var{format_arg}, tree @var{args_list})
+@deftypefn {C Target Hook} void TARGET_CHECK_STRING_OBJECT_FORMAT_ARG (tree @var{format_arg}, tree @var{args_list})
If a target implements string objects then this hook should should provide a facility to check the function arguments in @var{args_list} against the format specifiers in @var{format_arg} where the type of @var{format_arg} is one recognized as a valid string reference type.
@end deftypefn
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index 867006f..27949d1 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -91,6 +91,14 @@ form part of the @code{targetm} structure, it is documented below as a
from being defined in the @file{.h} file to being part of the
@code{targetm} structure.
+Similarly, there is a @code{targetcm} variable for hooks that are
+specific to front ends for C-family languages, documented as ``C
+Target Hook''. This is declared in @file{c-family/c-target.h}, the
+the initializer @code{TARGETCM_INITIALIZER} in
+@file{c-family/c-target-def.h}. If targets initialize @code{targetcm}
+themselves, they should set @code{target_has_targetcm=yes} in
+@file{config.gcc}; otherwise a default definition is used.
+
@node Driver
@section Controlling the Compilation Driver, @file{gcc}
@cindex driver