summaryrefslogtreecommitdiffstats
path: root/gcc/doc
diff options
context:
space:
mode:
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-22 06:51:56 +0000
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-22 06:51:56 +0000
commitd718b525701491becba5852fc642f13f9f1ed42f (patch)
tree33b0e3a2356eea4890c97f802528ed3f9e8ceebd /gcc/doc
parenta61b7bc46d0b0850dba55f8cd8afc33d729f14b1 (diff)
downloadppe42-gcc-d718b525701491becba5852fc642f13f9f1ed42f.tar.gz
ppe42-gcc-d718b525701491becba5852fc642f13f9f1ed42f.zip
2004-06-21 Geoffrey Keating <geoffk@apple.com>
* c-opts.c (c_common_handle_option): Handle -fpch-preprocess. * c-common.h (flag_pch_preprocess): Declare. (c_common_pch_pragma): Likewise. * c-common.c (flag_pch_preprocess): New. * c-pch.c (c_common_read_pch): Support -fpreprocess-only. (c_common_pch_pragma): New. * c-ppoutput.c (cb_read_pch): New. (init_pp_output): Support -fpch-preprocess. * c-pragma.c (init_pragma): Support #pragma GNUC pch_preprocess. * c.opt (fpch-preprocess): New. * gcc.c (cpp_options): When save-temps, pass -fpch-preprocess. * doc/cppopts.texi: Document -fpch-preprocess. * doc/invoke.texi (Precompiled Headers): Mention that -fpreprocessed is safe for PCH. Mention that if an option is listed as safe that doesn't mean it does what you expect. Index: gcc/testsuite/ChangeLog 2004-06-21 Geoffrey Keating <geoffk@apple.com> * gcc.dg/pch/save-temps-1.c: New file. * gcc.dg/pch/save-temps-1.hs: New file. Index: libcpp/ChangeLog 2004-06-21 Geoffrey Keating <geoffk@apple.com> * files.c (should_stack_file): Correct swapped parameters to call to cb.read_pch. * pch.c (cpp_valid_state): Handle -fpreprocessed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83478 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/cppopts.texi18
-rw-r--r--gcc/doc/invoke.texi8
2 files changed, 25 insertions, 1 deletions
diff --git a/gcc/doc/cppopts.texi b/gcc/doc/cppopts.texi
index 468f17f13fc..1b6307b2215 100644
--- a/gcc/doc/cppopts.texi
+++ b/gcc/doc/cppopts.texi
@@ -323,6 +323,24 @@ precompiled header would be listed and not the files that were used to
create it because those files are not consulted when a precompiled
header is used.
+@item -fpch-preprocess
+@opindex fpch-preprocess
+This option allows use of a precompiled header (@pxref{Precompiled
+Headers}) together with @option{-E}. It inserts a special @code{#pragma},
+@code{#pragma GCC pch_preprocess "<filename>"} in the output to mark
+the place where the precompiled header was found, and its filename. When
+@code{-fpreprocessed} is in use, GCC recognizes this @code{#pragma} and
+loads the PCH.
+
+This option is off by default, because the resulting preprocessed output
+is only really suitable as input to GCC. It is switched on by
+@option{-save-temps}.
+
+You should not write this @code{#pragma} in your own code, but it is
+safe to edit the filename if the PCH file is available in a different
+location. The filename may be absolute or it may be relative to GCC's
+current directory.
+
@end ifclear
@item -x c
@itemx -x c++
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 2dd2b8239d7..fcfb521812f 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -11809,7 +11809,7 @@ which options are safe to change and which are not; the safest choice
is to use exactly the same options when generating and using the
precompiled header. The following are known to be safe:
-@gccoptlist{-pedantic-errors}
+@gccoptlist{-fpreprocessed -pedantic-errors}
@end itemize
@@ -11819,6 +11819,12 @@ find an option combination that doesn't work and doesn't cause the
precompiled header to be ignored, please consider filing a bug report,
see @ref{Bugs}.
+If you do use differing options when generating and using the
+precompiled header, the actual behaviour will be a mixture of the
+behaviour for the options. For instance, if you use @option{-g} to
+generate the precompiled header but not when using it, you may or may
+not get debugging information for routines in the precompiled header.
+
@node Running Protoize
@section Running Protoize
OpenPOWER on IntegriCloud