* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51975 138bc75d-0d04-0410-961f-82ee72b054a4
Showing
- gcc/ChangeLog 32 additions, 0 deletionsgcc/ChangeLog
- gcc/cppinit.c 6 additions, 0 deletionsgcc/cppinit.c
- gcc/cpplex.c 25 additions, 6 deletionsgcc/cpplex.c
- gcc/cpplib.c 17 additions, 1 deletiongcc/cpplib.c
- gcc/cpplib.h 4 additions, 0 deletionsgcc/cpplib.h
- gcc/cppmacro.c 9 additions, 0 deletionsgcc/cppmacro.c
- gcc/doc/cppopts.texi 13 additions, 0 deletionsgcc/doc/cppopts.texi
- gcc/f/lang-specs.h 2 additions, 1 deletiongcc/f/lang-specs.h
- gcc/gcc.c 3 additions, 1 deletiongcc/gcc.c
- gcc/testsuite/gcc.dg/cpp/maccom1.c 17 additions, 0 deletionsgcc/testsuite/gcc.dg/cpp/maccom1.c
- gcc/testsuite/gcc.dg/cpp/maccom2.c 18 additions, 0 deletionsgcc/testsuite/gcc.dg/cpp/maccom2.c
- gcc/testsuite/gcc.dg/cpp/maccom3.c 17 additions, 0 deletionsgcc/testsuite/gcc.dg/cpp/maccom3.c
- gcc/testsuite/gcc.dg/cpp/maccom4.c 19 additions, 0 deletionsgcc/testsuite/gcc.dg/cpp/maccom4.c
- gcc/testsuite/gcc.dg/cpp/maccom5.c 21 additions, 0 deletionsgcc/testsuite/gcc.dg/cpp/maccom5.c
- gcc/testsuite/gcc.dg/cpp/maccom6.c 24 additions, 0 deletionsgcc/testsuite/gcc.dg/cpp/maccom6.c
Loading
Please register or sign in to comment