From 3963c2e00eaf827b8ededa284db7b1e3df0ad859 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Wed, 12 Feb 2003 17:01:53 +0000 Subject: [PATCH] cpplib.c (do_include_common): Move warnings for #include_next and #import out to callers. * cpplib.c (do_include_common): Move warnings for #include_next and #import out to callers. Use early-return instead of nested ifs. Don't do check_eol here. (parse_include): Do check_eol here with the rest of the parsing stuff. (do_include_next, do_import): Now handle warnings. From-SVN: r62772 --- gcc/ChangeLog | 59 +++++++++++++++++++++++++++-------------------- gcc/cpplib.c | 64 +++++++++++++++++++++++++++------------------------ 2 files changed, 68 insertions(+), 55 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d94f0169087..5f1c638b3ca 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2003-02-12 Zack Weinberg + + * cpplib.c (do_include_common): Move warnings for + #include_next and #import out to callers. Use early-return + instead of nested ifs. Don't do check_eol here. + (parse_include): Do check_eol here with the rest of the + parsing stuff. + (do_include_next, do_import): Now handle warnings. + 2003-02-11 Gerald Pfeifer * doc/install.texi (Specific): Update AVR- and Darwin-related URLs. @@ -170,10 +179,10 @@ Tue Feb 11 10:02:54 CET 2003 Jan Hubicka in add_ext_symbol, and avoid signed/unsigned conditional warning. 2003-02-10 Nick Clifton - Aldy Hernandez + Aldy Hernandez - * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Do not - override options which have been specified on the command line. + * config/rs6000/eabispe.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Do not + override options which have been specified on the command line. 2003-02-10 Kazu Hirata @@ -193,7 +202,7 @@ Tue Feb 11 10:02:54 CET 2003 Jan Hubicka 2003-02-10 Josef Zlomek * Makefile.in (bb-reorder.o): Add dependency on $(FIBHEAP_H). - * bb-reorder.c (make_reorder_chain): Deleted. + * bb-reorder.c (make_reorder_chain): Deleted. (make_reorder_chain_1): Deleted. (find_traces): New function. (rotate_loop): New function. @@ -216,7 +225,7 @@ Tue Feb 11 10:02:54 CET 2003 Jan Hubicka 2003-02-09 Dan Nicolaescu * tree.h (struct tree_decl): Remove unused live_range_rtl field. - (DECL_LIVE_RANGE_RTL): Remove. + (DECL_LIVE_RANGE_RTL): Remove. 2003-02-10 Nick Clifton @@ -244,7 +253,7 @@ Tue Feb 11 10:02:54 CET 2003 Jan Hubicka ctzsi2, paritysi2, and popcountsi2. 2003-02-10 Eric Botcazou - Christian Ehrhardt + Christian Ehrhardt PR c/7741 * c-decl.c (duplicate_decls): Discard the initializer of the @@ -262,7 +271,7 @@ Tue Feb 11 10:02:54 CET 2003 Jan Hubicka * Contributed support for the Cirrus EP9312 "Maverick" floating point co-processor. Written by Aldy Hernandez - . + . (config/arm/arm.c): Add Cirrus support. (config/arm/arm.h): Likewise. (config/arm/aout.h): Likewise. @@ -286,23 +295,23 @@ Mon Feb 10 11:40:18 CET 2003 Jan Hubicka (store_one_arg): Likewise. 2003-02-09 Nick Clifton - Aldy Hernandez + Aldy Hernandez - * config/rs6000/spe.md: spe_evlhhesplat, spe_evlhhossplat, - spe_evlhhousplat, spe_evlwhsplat, spe_evlwwsplat, spe_evldd, - spe_evldh, spe_evldw, spe_evlwhe, spe_evlwhos, spe_evlwhou, - spe_evstdd, spe_evstdh, spe_evstdw, spe_evstdwx, spe_evstwhe, - spe_evstwho, spe_evstwwe, spe_evstwwo: Fix syntax to match newest - docs. Add range test for immediate value. + * config/rs6000/spe.md: spe_evlhhesplat, spe_evlhhossplat, + spe_evlhhousplat, spe_evlwhsplat, spe_evlwwsplat, spe_evldd, + spe_evldh, spe_evldw, spe_evlwhe, spe_evlwhos, spe_evlwhou, + spe_evstdd, spe_evstdh, spe_evstdw, spe_evstdwx, spe_evstwhe, + spe_evstwho, spe_evstwwe, spe_evstwwo: Fix syntax to match newest + docs. Add range test for immediate value. 2003-02-09 Aldy Hernandez - Rename spe_evxor to xorv2si3. - (xorv4hi3): New. - (xorv1di3): New. + Rename spe_evxor to xorv2si3. + (xorv4hi3): New. + (xorv1di3): New. 2003-02-10 Glen Nakamura - + * doc/extend.texi (C++98 Thread-Local Edits): Add missing @item tag. @@ -460,17 +469,17 @@ Sat Feb 8 00:21:22 CET 2003 Jan Hubicka 2003-02-07 Richard Henderson PR 9226 - * gcse.c (local_cprop_find_used_regs): New. - (local_cprop_pass): Use it. + * gcse.c (local_cprop_find_used_regs): New. + (local_cprop_pass): Use it. 2003-02-07 Fred Fish * mips-tfile.c (parse_def): Parenthesize assignments to fix - precedence bugs. + precedence bugs. 2003-02-07 Segher Boessenkool - * genoutput.c (output_get_insn_name): Handle NOOP_MOVE_INSN_CODE. + * genoutput.c (output_get_insn_name): Handle NOOP_MOVE_INSN_CODE. 2003-02-07 Roger Sayle @@ -569,7 +578,7 @@ Fri Feb 7 02:18:57 CET 2003 Jan Hubicka * combine.c (nonzero_bits): Fix double break. 2003-02-06 Eric Botcazou - Richard Henderson + Richard Henderson PR c/9530 * config/i386/i386.c (ix86_function_ok_for_sibcall): Forbid sibcalls @@ -646,8 +655,8 @@ Thu Feb 6 00:18:38 CET 2003 Jan Hubicka 2003-02-05 Richard Henderson PR c/8602 - * integrate.c (output_inline_function): Reset input_filename - and lineno from the decl before rest_of_compilation. + * integrate.c (output_inline_function): Reset input_filename + and lineno from the decl before rest_of_compilation. 2003-02-05 Richard Henderson diff --git a/gcc/cpplib.c b/gcc/cpplib.c index a40fe1229ff..b63fd262339 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -655,6 +655,7 @@ parse_include (pfile) return NULL; } + check_eol (pfile); return header; } @@ -664,39 +665,25 @@ do_include_common (pfile, type) cpp_reader *pfile; enum include_type type; { - const cpp_token *header; + const cpp_token *header = parse_include (pfile); + if (!header) + return; - /* For #include_next, if this is the primary source file, warn and - use the normal search logic. */ - if (type == IT_INCLUDE_NEXT && ! pfile->buffer->prev) + /* Prevent #include recursion. */ + if (pfile->line_maps.depth >= CPP_STACK_MAX) { - cpp_error (pfile, DL_WARNING, "#include_next in primary source file"); - type = IT_INCLUDE; - } - else if (type == IT_IMPORT && CPP_OPTION (pfile, warn_import)) - { - CPP_OPTION (pfile, warn_import) = 0; - cpp_error (pfile, DL_WARNING, - "#import is obsolete, use an #ifndef wrapper in the header file"); + cpp_error (pfile, DL_ERROR, "#include nested too deeply"); + return; } - header = parse_include (pfile); - if (header) - { - /* Prevent #include recursion. */ - if (pfile->line_maps.depth >= CPP_STACK_MAX) - cpp_error (pfile, DL_ERROR, "#include nested too deeply"); - else - { - check_eol (pfile); - /* Get out of macro context, if we are. */ - skip_rest_of_line (pfile); - if (pfile->cb.include) - (*pfile->cb.include) (pfile, pfile->directive_line, - pfile->directive->name, header); - _cpp_execute_include (pfile, header, type); - } - } + /* Get out of macro context, if we are. */ + skip_rest_of_line (pfile); + + if (pfile->cb.include) + (*pfile->cb.include) (pfile, pfile->directive_line, + pfile->directive->name, header); + + _cpp_execute_include (pfile, header, type); } static void @@ -710,6 +697,13 @@ static void do_import (pfile) cpp_reader *pfile; { + if (CPP_OPTION (pfile, warn_import)) + { + CPP_OPTION (pfile, warn_import) = 0; + cpp_error (pfile, DL_WARNING, + "#import is obsolete, use an #ifndef wrapper in the header file"); + } + do_include_common (pfile, IT_IMPORT); } @@ -717,7 +711,17 @@ static void do_include_next (pfile) cpp_reader *pfile; { - do_include_common (pfile, IT_INCLUDE_NEXT); + enum include_type type = IT_INCLUDE_NEXT; + + /* If this is the primary source file, warn and use the normal + search logic. */ + if (! pfile->buffer->prev) + { + cpp_error (pfile, DL_WARNING, + "#include_next in primary source file"); + type = IT_INCLUDE; + } + do_include_common (pfile, type); } /* Subroutine of do_linemarker. Read possible flags after file name.