summaryrefslogtreecommitdiffstats
path: root/gcc/doc
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-31 15:51:42 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-31 15:51:42 +0000
commit761d9126bbf0baa274bbfed2ff31f934a6d4c899 (patch)
tree6493f351baf9a917bfbcf8a8a1c3c4db18abd2ed /gcc/doc
parent6252c2813fc1febff406ddfcecbdeda6ca7613b3 (diff)
downloadppe42-gcc-761d9126bbf0baa274bbfed2ff31f934a6d4c899.tar.gz
ppe42-gcc-761d9126bbf0baa274bbfed2ff31f934a6d4c899.zip
* doc/tm.texi (TARGET_GET_PCH_VALIDITY, TARGET_PCH_VALID_P): Tweak
the documentation to make it more future-proof. (TARGET_CHECK_PCH_TARGET_FLAGS): Document this new hook. * target.h (gcc_target): Add check_pch_target_flags. * target-def.h (TARGET_CHECK_PCH_TARGET_FLAGS): New macro. (TARGET_INITIALIZER): Include it. * toplev.c (default_pch_valid_p): Use targetm.check_pch_target_flags. * config/sh/sh.h (sh_pch_valid_p): Delete. * config/sh/sh.c (TARGET_PCH_VALID_P, sh_pch_valid_p): Delete. (sh_check_pch_target_flags): New function. (TARGET_CHECK_PCH_TARGET_FLAGS): Override default. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100392 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/tm.texi44
1 files changed, 26 insertions, 18 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index a82d353dfbb..a09f503f754 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -8668,24 +8668,32 @@ Default: empty.
@section Parameters for Precompiled Header Validity Checking
@cindex parameters, precompiled headers
-@deftypefn {Target Hook} void * TARGET_GET_PCH_VALIDITY (size_t * @var{sz})
-Define this hook if your target needs to check a different collection
-of flags than the default, which is every flag defined by
-@code{TARGET_SWITCHES} and @code{TARGET_OPTIONS}. It should return
-some data which will be saved in the PCH file and presented to
-@code{TARGET_PCH_VALID_P} later; it should set @code{SZ} to the size
-of the data.
-@end deftypefn
-
-@deftypefn {Target Hook} const char * TARGET_PCH_VALID_P (const void * @var{data}, size_t @var{sz})
-Define this hook if your target needs to check a different collection of
-flags than the default, which is every flag defined by @code{TARGET_SWITCHES}
-and @code{TARGET_OPTIONS}. It is given data which came from
-@code{TARGET_GET_PCH_VALIDITY} (in this version of this compiler, so there
-is no need for extensive validity checking). It returns @code{NULL} if
-it is safe to load a PCH file with this data, or a suitable error message
-if not. The error message will be presented to the user, so it should
-be localized.
+@deftypefn {Target Hook} void *TARGET_GET_PCH_VALIDITY (size_t *@var{sz})
+This hook returns the data needed by @code{TARGET_PCH_VALID_P} and sets
+@samp{*@var{sz}} to the size of the data in bytes.
+@end deftypefn
+
+@deftypefn {Target Hook} const char *TARGET_PCH_VALID_P (const void *@var{data}, size_t @var{sz})
+This hook checks whether the options used to create a PCH file are
+compatible with the current settings. It returns @code{NULL}
+if so and a suitable error message if not. Error messages will
+be presented to the user and must be localized using @samp{_(@var{msg})}.
+
+@var{data} is the data that was returned by @code{TARGET_GET_PCH_VALIDITY}
+when the PCH file was created and @var{sz} is the size of that data in bytes.
+It's safe to assume that the data was created by the same version of the
+compiler, so no format checking is needed.
+
+The default definition of @code{default_pch_valid_p} should be
+suitable for most targets.
+@end deftypefn
+
+@deftypefn {Target Hook} const char *TARGET_CHECK_PCH_TARGET_FLAGS (int @var{pch_flags})
+If this hook is nonnull, the default implementation of
+@code{TARGET_PCH_VALID_P} will use it to check for compatible values
+of @code{target_flags}. @var{pch_flags} specifies the value that
+@code{target_flags} had when the PCH file was created. The return
+value is the same as for @code{TARGET_PCH_VALID_P}.
@end deftypefn
@node C++ ABI
OpenPOWER on IntegriCloud