@@ -368,13 +368,11 @@ c_common_handle_option (size_t scode, const char *arg, int value,
break;
case OPT__output_pch_:
- {
- char *dot = strrchr (arg, '.');
- if (dot != NULL && strcmp (dot, ".pph") == 0)
- pph_out_file = arg;
- else
- pch_file = arg;
- }
+ pch_file = arg;
+ break;
+
+ case OPT__output_pph_:
+ pph_out_file = arg;
break;
case OPT_A:
@@ -139,6 +139,9 @@ C ObjC C++ ObjC++ Joined Alias(o)
-output-pch=
C ObjC C++ ObjC++ Joined Separate
+-output-pph=
+C++ Joined Separate
+
-pedantic
C ObjC C++ ObjC++ Alias(pedantic)
@@ -933,8 +936,12 @@ fpph-dump-tree
C++ Var(flag_pph_dump_tree)
-fpph-dump-tree Dump global namespace tree around PPH reads/writes.
+fpph-gen
+C++
+-fpph-gen Generate a PPH image from the input file
+
fpph-hdr=
-C++ ObjC++ Joined MissingArgError(missing filename after %qs)
+C++ Joined MissingArgError(missing filename after %qs)
-fpph-hdr=<base-name> A mapping from <base-name>.h to <base-name>.pph
fpph-logfile=
@@ -942,7 +949,7 @@ C++ Joined RejectNegative Var(flag_pph_logfile)
-fpph-logfile=<file-name> Emit PPH debug information to <file-name>
fpph-map=
-C++ ObjC++ Joined MissingArgError(missing filename after %qs)
+C++ Joined MissingArgError(missing filename after %qs)
-fpph-map=<file-name> A file of mappings from #include to PPH file
fpph-tracer=
@@ -48,8 +48,9 @@ along with GCC; see the file COPYING3. If not see
cc1plus %{save-temps*|no-integrated-cpp:-fpreprocessed %{save-temps*:%b.ii} %{!save-temps*:%g.ii}}\
%{!save-temps*:%{!no-integrated-cpp:%(cpp_unique_options)}}\
%(cc1_options) %2\
- %{!fsyntax-only:%{!fdump-ada-spec*:-o %g.s %{!o*:--output-pch=%i.gch}\
- %W{o*:--output-pch=%*}}%V}}}}",
+ %{!fpph-gen:%{!fsyntax-only:%{!fdump-ada-spec*:-o %g.s %{!o*:--output-pch=%i.gch}\
+ %W{o*:--output-pch=%*}}}} \
+ %{fpph-gen:%{!o*:--output-pph=%b.pph}%W{o*:--output-pph=%*}}%V}}}",
CPLUSPLUS_CPP_SPEC, 0, 0},
{"@c++",
"%{E|M|MM:cc1plus -E %(cpp_options) %2 %(cpp_debug_options)}\
@@ -195,6 +195,7 @@ in the following sections.
-fno-threadsafe-statics -fuse-cxa-atexit -fno-weak -nostdinc++ @gol
-fno-default-inline -fvisibility-inlines-hidden @gol
-fvisibility-ms-compat @gol
+-fpph-hdr -fpph-map -fpph-gen @gol
-Wabi -Wconversion-null -Wctor-dtor-privacy @gol
-Wnoexcept -Wnon-virtual-dtor -Wreorder @gol
-Weffc++ -Wstrict-null-sentinel @gol
@@ -2171,6 +2172,42 @@ option exists only for testing, and should not be used by end-users;
it will result in inferior code and has no benefits. This option may
be removed in a future release of G++.
+@item -fpph-gen
+@opindex fpph-gen
+Generate a Pre-Parsed Header (PPH) file instead of a PCH file. This option
+is only valid when compiling header files separately. Instead of generating
+a PCH files, G++ will save the parsed declarations in a header file to
+a PPH file. By default, the PPH image for a header file named @file{foo.h}
+is @file{foo.pph}.
+
+NOTE: This option is temporary. It is only meant to serve the initial
+implementation of this feature. The final user interface will likely
+use a different mechanism for PPH.
+
+@item -fpph-map=@var{file.map}
+@opindex fpph-map
+Use PPH mapping file @file{file.map} to determine what headers should be
+processed from their PPH images. This file contains a list of file name
+pairs in the form ``@var{file.h} @var{file.pph}''. When the pre-processor
+finds the directive @code{#include "file.h"}, and there exists a mapping
+between @var{file.h} and @var{file.pph} in @file{file.map}, then the
+compiler will instantiate the PPH image @var{file.pph}. The text
+in @var{file.h} will be ignored.
+
+NOTE: This option is temporary. It is only meant to serve the initial
+implementation of this feature. The final user interface will likely
+use a different mechanism for PPH.
+
+@item -fpph-hdr=@var{file.h}
+@opindex fpph-hdr
+This is a short-hand notation to map a single header @file{file.h} to
+its image @file{file.pph}. Multiple occurrences of this flag will
+introduce multiple mappings.
+
+NOTE: This option is temporary. It is only meant to serve the initial
+implementation of this feature. The final user interface will likely
+use a different mechanism for PPH.
+
@item -nostdinc++
@opindex nostdinc++
Do not search for header files in the standard directories specific to
@@ -33,7 +33,7 @@ proc dg-pph-hdr { subdir test options mapflag suffix } {
verbose -log "\nTesting $nshort, $options"
set dg-do-what-default preparse
- dg-test -keep-output $test "$options $mapflag -I." ""
+ dg-test -keep-output $test "-fpph-gen $options $mapflag -I." ""
}
@@ -51,7 +51,7 @@ proc dg-pph-neg { subdir test options mapflag suffix } {
verbose -log "\nTesting $nshort, $options"
set dg-do-what-default compile
- dg-test -keep-output $test "$options $mapflag -I." ""
+ dg-test -keep-output $test "-fpph-gen $options $mapflag -I." ""
if { ![file_on_host exists "$bname.s"] } {
file_on_host delete "$bname.s"
}