This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r127066 - in /trunk: gcc/ChangeLog gcc/c-opts.c...
- From: aaw at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Mon, 30 Jul 2007 18:29:21 -0000
- Subject: r127066 - in /trunk: gcc/ChangeLog gcc/c-opts.c...
Author: aaw
Date: Mon Jul 30 18:29:20 2007
New Revision: 127066
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127066
Log:
libcpp/
* directives-only.c: New file.
* internal.h (struct _cpp_dir_only_callbacks): New.
(_cpp_preprocess_dir_only): New function.
* directives.c (_cpp_handle_directive): Check directives_only before
disabling execution of indented directives.
* files.c (_cpp_stack_file): Add directives_only check.
* include/cpplib.h (struct cpp_options): Add directives_only.
(cpp_init_special_builtins): New function.
* init.c (cpp_init_special_builtins): New function.
(cpp_init_builtins): Move builtin_array initialization to
cpp_init_special_builtins.
(post_options): Check directives_only before setting
pfile->state.prevent_expansion = 1.
* macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
is expanded inside a directive while -fdirectives-only is enabled.
* Makefile.in (libcpp_a_OBJS): Add directives-only.o.
(libcpp_a_SOURCES): Add directives-only.c.
gcc/
* c-ppoutput.c (print_lines_directives_only): New function.
(scan_translation_unit_directives_only): New function.
(preprocess_file): Add call to scan_translation_unit_directives_only.
* c-opts.c (c_common_handle_option): Add OPT_fdirectives_only.
(sanitize_cpp_opts): Add default flag_dump_macros setting for
-fdirectives-only. Add errors for -fdirectives-only conflict with
-Wunused-macros and -traditional.
(finish_options): Add builtin macro initialization for
-fdirectives-only + -fpreprocessed.
* c.opt (fdirectives-only): New.
* doc/cppopts.texi (fdirectives-only): New.
gcc/testsuite/
* gcc.dg/cpp/counter-2.c: New test.
* gcc.dg/cpp/counter-3.c: New test.
* gcc.dg/cpp/dir-only-1.c: New test.
* gcc.dg/cpp/dir-only-1.h: New file.
* gcc.dg/cpp/dir-only-2.c: New test.
* gcc.dg/cpp/dir-only-3.c: New test.
* gcc.dg/cpp/dir-only-3a.h: New file.
* gcc.dg/cpp/dir-only-3b.h: New file.
* gcc.dg/cpp/dir-only-4.c: New test.
* gcc.dg/cpp/dir-only-5.c: New test.
* gcc.dg/cpp/dir-only-6.c: New test.
Added:
trunk/gcc/testsuite/gcc.dg/cpp/counter-2.c
trunk/gcc/testsuite/gcc.dg/cpp/counter-3.c
trunk/gcc/testsuite/gcc.dg/cpp/dir-only-1.c
trunk/gcc/testsuite/gcc.dg/cpp/dir-only-1.h
trunk/gcc/testsuite/gcc.dg/cpp/dir-only-2.c
trunk/gcc/testsuite/gcc.dg/cpp/dir-only-3.c
trunk/gcc/testsuite/gcc.dg/cpp/dir-only-3a.h
trunk/gcc/testsuite/gcc.dg/cpp/dir-only-3b.h
trunk/gcc/testsuite/gcc.dg/cpp/dir-only-4.c
trunk/gcc/testsuite/gcc.dg/cpp/dir-only-5.c
trunk/gcc/testsuite/gcc.dg/cpp/dir-only-6.c
trunk/libcpp/directives-only.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-opts.c
trunk/gcc/c-ppoutput.c
trunk/gcc/c.opt
trunk/gcc/doc/cppopts.texi
trunk/gcc/testsuite/ChangeLog
trunk/libcpp/ChangeLog
trunk/libcpp/Makefile.in
trunk/libcpp/directives.c
trunk/libcpp/files.c
trunk/libcpp/include/cpplib.h
trunk/libcpp/init.c
trunk/libcpp/internal.h
trunk/libcpp/macro.c