diff options
author | Richard Sandiford <rsandifo@redhat.com> | 2005-05-31 15:51:42 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2005-05-31 15:51:42 +0000 |
commit | 8d932be3e1502485e9fb78695b7c2c4bdb7653cd (patch) | |
tree | 6493f351baf9a917bfbcf8a8a1c3c4db18abd2ed /gcc/doc/tm.texi | |
parent | 4ea73bfac370705eaf74e204264bf994c51bdfd9 (diff) | |
download | gcc-8d932be3e1502485e9fb78695b7c2c4bdb7653cd.zip gcc-8d932be3e1502485e9fb78695b7c2c4bdb7653cd.tar.gz gcc-8d932be3e1502485e9fb78695b7c2c4bdb7653cd.tar.bz2 |
tm.texi (TARGET_GET_PCH_VALIDITY, [...]): Tweak the documentation to make it more future-proof.
* 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.
From-SVN: r100392
Diffstat (limited to 'gcc/doc/tm.texi')
-rw-r--r-- | gcc/doc/tm.texi | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index a82d353..a09f503 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 |