summaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorJason Thorpe <thorpej@wasabisystems.com>2002-04-07 03:12:23 +0000
committerJason Thorpe <thorpej@gcc.gnu.org>2002-04-07 03:12:23 +0000
commit477cdac7549280eaf6d79ab9dce15e0099e01ce0 (patch)
treea89c2d17b9489b6bd19288f037013b3eaa28a891 /gcc/gcc.c
parent03da52864c9025823694a9b5fabc472c6e534658 (diff)
downloadgcc-477cdac7549280eaf6d79ab9dce15e0099e01ce0.tar.gz
cppinit.c (cpp_create_reader): Initialize discard_comments_in_macro_exp.
* cppinit.c (cpp_create_reader): Initialize discard_comments_in_macro_exp. (COMMAND_LINE_OPTIONS): Add "-CC" option. (cpp_handle_option): Handle "-CC" option. * cpplex.c (save_comment): If saving a C++ comment in a directive, convert it to a C comment. (_cpp_lex_direct): Pass second comment start character to save_comment to indicate comment type. * cpplib.c (_cpp_handle_directive): If processing a "#define" directive and discard_comments_in_macro_exp is false, re-enable saving of comments. (lex_macro_node): If discard_comments_in_macro_exp is false, discard any comments before the macro identifier. * cpplib.h (struct cpp_options): Add discard_comments_in_macro_exp member. * cppmacro.c (cpp_get_token): If expanding a macro while processing a directive, discard any comments we might encounter. (parse_params): If discard_comments_in_macro_exp is false, ignore comments in the macro parameter list. * gcc.c (cpp_unique_options): Add "-CC" option. (option_map): Map "--comments-in-macros" to "-CC". * doc/cppopts.texi: Document "-CC" option. * f/lang-specs.h: Add "-CC" option. * testsuite/gcc.dg/cpp/maccom1.c: New test. * testsuite/gcc.dg/cpp/maccom2.c: New test. * testsuite/gcc.dg/cpp/maccom3.c: New test. * testsuite/gcc.dg/cpp/maccom4.c: New test. * testsuite/gcc.dg/cpp/maccom5.c: New test. * testsuite/gcc.dg/cpp/maccom6.c: New test. From-SVN: r51975
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index d0d0e3f079a..c160006f88d 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -671,7 +671,8 @@ static const char *trad_capable_cpp =
static const char *cpp_unique_options =
"%{C:%{!E:%eGNU C does not support -C without using -E}}\
- %{!Q:-quiet} %{nostdinc*} %{C} %{v} %{I*} %{P} %{$} %I\
+ %{CC:%{!E:%eGNU C does not support -CC without using -E}}\
+ %{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %{$} %I\
%{MD:-MD %W{!o: %b.d}%W{o*:%.d%*}}\
%{MMD:-MMD %W{!o: %b.d}%W{o*:%.d%*}}\
%{M} %{MM} %W{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
@@ -917,6 +918,7 @@ static const struct option_map option_map[] =
{"--bootclasspath", "-fbootclasspath=", "aj"},
{"--CLASSPATH", "-fclasspath=", "aj"},
{"--comments", "-C", 0},
+ {"--comments-in-macros", "-CC", 0},
{"--compile", "-c", 0},
{"--debug", "-g", "oj"},
{"--define-macro", "-D", "aj"},