Skip to content
Snippets Groups Projects
  1. Feb 18, 2006
    • Grigory Zagorodnev's avatar
      cpp.texi (__TIMESTAMP__): Document. · be8ac3e2
      Grigory Zagorodnev authored
      2006-02-17  Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
      
      gcc/ChangeLog:
           * doc/cpp.texi (__TIMESTAMP__): Document.
      
      libcpp/ChangeLog:
           * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
           * files.c (_cpp_get_file_stat): New function.
           * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
           * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
           * internal.h (_cpp_get_file_stat): Prototype.
           (struct cpp_buffer): Add timestamp.
      
      gcc/testsuite/ChangeLog:
           * gcc.dg/cpp/undef3.c: New test.
           * gcc.dg/cpp/trad/builtins2.c: New test.
      
      From-SVN: r111232
      be8ac3e2
  2. Jan 23, 2006
  3. Nov 09, 2005
    • Uros Bizjak's avatar
      re PR c/24101 (Segfault with preprocessed source) · 456b8ce5
      Uros Bizjak authored
      libcpp/
      
      	PR c/24101
      	* init.c (read_original_filename): Temporarily set
      	state.in_directive before calling _cpp_lex_direct for
      	CPP_HASH tokens.
      
      gcc/
      
      	PR c/24101
      	* toplev.c (process_options): Initialize debug_hooks early
      	in case lang_hooks.post_options ends up calling a debug_hook.
      
      gcc/testsuite/
      
      	PR c/24101
      	* gcc.dg/pr24101-1.i, gcc.dg/pr24101-2.i: New tests.
      	* gcc.dg/dg.exp: Run main loop also for *.i files.
      
      From-SVN: r106677
      456b8ce5
  4. Oct 21, 2005
    • James E Wilson's avatar
      Fix bug with -MM -MG. · 6568f34b
      James E Wilson authored
      PR preprocessor/15220
      * files.c (_cpp_find_file): New parameter angle_brackets.  Fix all
      callers.  Pass to open_file_failed.
      (open_file_failed): New parameter angle_brackets.  Fix all callers.
      Use in print_dep assignment.
      * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
      * internal.h (_cpp_find_file): Add new parm to declaration.
      
      From-SVN: r105757
      6568f34b
  5. Sep 20, 2005
    • Joseph Myers's avatar
      c.opt (fextended-identifiers): New. · af15a2fe
      Joseph Myers authored
      gcc:
      	* c.opt (fextended-identifiers): New.
      	* c-opts.c (c_common_handle_option): Handle
      	-fextended-identifiers.
      	* doc/cpp.texi: Update documentation of extended identifiers.
      	* doc/cppopts.texi (-fextended-identifiers): Document.
      
      gcc/testsuite:
      	* g++.dg/cpp/ucnid-1.C, g++.dg/cpp/normalize-1.C,
      	g++.dg/other/ucnid-1.C, gcc.dg/cpp/normalize-1.c,
      	gcc.dg/cpp/normalize-2.c, gcc.dg/cpp/normalize-3.c,
      	gcc.dg/cpp/normalize-4.c, gcc.dg/cpp/ucnid-1.c,
      	gcc.dg/cpp/ucnid-2.c, gcc.dg/cpp/ucnid-3.c, gcc.dg/cpp/ucnid-4.c,
      	gcc.dg/cpp/ucnid-5.c, gcc.dg/cpp/ucnid-7.c,gcc.dg/ucnid-1.c,
      	gcc.dg/ucnid-2.c, gcc.dg/ucnid-3.c, gcc.dg/ucnid-4.c,
      	gcc.dg/ucnid-5.c, gcc.dg/ucnid-6.c: Add -fextended-identifiers.
      	* gcc.dg/cpp/ucnid-8.c: New test.
      
      libcpp:
      	* include/cpplib.h (struct cpp_options): Add extended_identifiers.
      	* init.c (struct lang_flags, lang_defaults): Add
      	extended_identifiers.
      	(cpp_set_lang): Use it.
      	* lex.c (forms_identifier_p): Check extended_identifiers.
      
      From-SVN: r104462
      af15a2fe
  6. Jun 29, 2005
  7. May 28, 2005
    • Gabriel Dos Reis's avatar
      configure.ac: Check declarations for asprintf and vasprintf. · c3f829c1
      Gabriel Dos Reis authored
      	* configure.ac: Check declarations for asprintf and vasprintf.
      	* config.in: Regenerate.
      	* configure: Likewise.
      
      	* charset.c (conversion_loop): Use XRESIZEVEC.
      	(convert_no_conversion): Likewise.
      	(convert_using_iconv): Likewise.
      	(init_iconv_desc): Cast return value of alloca.
      	(cpp_host_to_exec_charset): Use XNEWVEC.
      	(emit_numeric_escape): Use XRESIZEVEC.
      	(cpp_interpret_string): Use XNEWVEC.
      	(cpp_interpret_string): Use XRESIZEVEC.
      	(_cpp_interpret_identifier): Cast return value of alloca.
      	(_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
      	* directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
      	(parse_include): Use XNEWVEC.
      	(insert_pragma_entry): Rename local variable "new" to
      	"new_entry".
      	(save_registered_pragmas): Cast return value of xmemdup.
      	(destringize_and_run): Same for alloca.
      	(parse_assertion): Likewise.
      	(do_assert): Cast allocated storage to proper type.
      	(cpp_define): Likewise.
      	(_cpp_define_builtin): Likewise.
      	(cpp_undef): Likewise.
      	(handle_assertion): Likewise.
      	(cpp_push_buffer): Rename local variable "new" to "new_buffer".
      	* expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
      	(CPP_UMINUS): Likewise.
      	(struct cpp_operator): Rename from struct operator.
      	(_cpp_expand_op_stack): Use XRESIZEVEC.
      	* files.c (pch_open_file): Use XNEWVEC.
      	(pch_open_file): Use XRESIZEVEC.
      	(read_file_guts): Use XNEWVEC and XRESIZEVEC.
      	(dir_name_of_file): Use XNEWVEC.
      	(make_cpp_file): Use XCNEW.
      	(make_cpp_dir): Likewise.
      	(allocate_file_hash_entries): USE XNEWVEC.
      	(cpp_included): Cast return value of htab_find_with_hash.
      	(append_file_to_dir): Use XNEWVEC.
      	(read_filename_string): Likewise. Use XRESIZEVEC too.
      	(read_name_map): Cast return value of alloca.  Use XRESIZEVEC.
      	(remap_filename): Use XNEWVEC.
      	(struct pchf_entry): Move definition out of struct pchf_data.
      	(_cpp_save_file_entries): Use XCNEWVAR.
      	(_cpp_read_file_entries): Use XNEWVAR.
      	* identifiers.c (alloc_node): Use XOBNEW.
      	* init.c (cpp_create_reader): Use XCNEW.
      	(cpp_init_builtins): Cast of b->value to enum builtin_type.
      	(read_original_directory): Cast return value of alloca.
      	* lex.c (add_line_note): Use XRESIZEVEC.
      	(warn_about_normalization): Use XNEWVEC.
      	(_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
      	(new_buff): Use XNEWVEC.
      	* line-map.c (linemap_add): Use XRESIZEVEC.
      	* macro.c (builtin_macro): Cast return value of alloca.
      	(paste_tokens): Likewise.
      	(expand_arg): Use XNEWVEC and XRESIZEVEC.
      	(_cpp_save_parameter): Use XRESIZEVEC.
      	(create_iso_definition): Cast allocated storage to proper type.
      	(_cpp_create_definition): Likewise.
      	(cpp_macro_definition): Use XRESIZEVEC.
      	* makedepend.c (add_clm): Use XNEW.
      	(add_dir): Likewise.
      	* mkdeps.c (munge): Use XNEWVEC.
      	(deps_init): Use XCNEW.
      	(deps_add_target): Use XRESIZEVEC.
      	(deps_add_default_target): Cast return value of alloca.
      	(deps_add_dep): Use XRESIZEVEC.
      	(deps_add_vpath): Likewise.  Use XNEWVEC too.
      	(deps_restore): Likewise.
      	* pch.c (save_idents): Use XNEW and XNEWVEC.
      	(cpp_save_state): Use XNEW.
      	(count_defs): Cast return value of htab_find.
      	(write_defs): Likewise.
      	(cpp_write_pch_deps): Use XNEWVEC.
      	(collect_ht_nodes): Use XRESIZEVEC.
      	(cpp_valid_state): Use XNEWVEC.
      	(save_macros): Use XRESIZEVEC.  Cast return value of xmemdup.
      	* symtab.c (ht_create): Use XCNEW.
      	(ht_lookup_with_hash): Cast return value of obstack_copy0.
      	(ht_expand): Use XCNEWVEC.
      	* system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
      	(bool): Do not define if __cplusplus.
      
      From-SVN: r100295
      c3f829c1
  8. Mar 15, 2005
    • Geoffrey Keating's avatar
      Index: gcc/ChangeLog · 50668cf6
      Geoffrey Keating authored
      2005-03-14  Geoffrey Keating  <geoffk@apple.com>
      
      	* doc/cppopts.texi (-fexec-charset): Add concept index entry.
      	(-fwide-exec-charset): Likewise.
      	(-finput-charset): Likewise.
      	* doc/invoke.texi (Warning Options): Document -Wnormalized=.
      	* c-opts.c (c_common_handle_option): Handle -Wnormalized=.
      	* c.opt (Wnormalized): New.
      
      Index: libcpp/ChangeLog
      2005-03-14  Geoffrey Keating  <geoffk@apple.com>
      
      	* init.c (cpp_create_reader): Default warn_normalize to normalized_C.
      	* charset.c: Update for new format of ucnid.h.
      	(ucn_valid_in_identifier): Update for new format of ucnid.h.
      	Add NST parameter, and update it; update callers.
      	(cpp_valid_ucn): Add NST parameter, update callers.  Replace abort
      	with cpp_error.
      	(convert_ucn): Pass normalize_state to cpp_valid_ucn.
      	* internal.h (struct normalize_state): New.
      	(INITIAL_NORMALIZE_STATE): New.
      	(NORMALIZE_STATE_RESULT): New.
      	(NORMALIZE_STATE_UPDATE_IDNUM): New.
      	(_cpp_valid_ucn): New.
      	* lex.c (warn_about_normalization): New.
      	(forms_identifier_p): Add normalize_state parameter, update callers.
      	(lex_identifier): Add normalize_state parameter, update callers.  Keep
      	the state current.
      	(lex_number): Likewise.
      	(_cpp_lex_direct): Pass normalize_state to subroutines.  Check
      	it with warn_about_normalization.
      	* makeucnid.c: New.
      	* ucnid.h: Replace.
      	* ucnid.pl: Remove.
      	* ucnid.tab: Make appropriate for input to makeucnid.c.  Remove
      	comments about obsolete version of C++.
      	* include/cpplib.h (enum cpp_normalize_level): New.
      	(struct cpp_options): Add warn_normalize field.
      
      Index: gcc/testsuite/ChangeLog
      2005-03-14  Geoffrey Keating  <geoffk@apple.com>
      
      	* gcc.dg/cpp/normalize-1.c: New.
      	* gcc.dg/cpp/normalize-2.c: New.
      	* gcc.dg/cpp/normalize-3.c: New.
      	* gcc.dg/cpp/normalize-4.c: New.
      	* gcc.dg/cpp/ucnid-4.c: New.
      	* gcc.dg/cpp/ucnid-5.c: New.
      	* g++.dg/cpp/normalize-1.C: New.
      	* g++.dg/cpp/ucnid-1.C: New.
      
      From-SVN: r96459
      50668cf6
  9. Feb 14, 2005
  10. Jan 02, 2005
  11. Sep 24, 2004
    • Zack Weinberg's avatar
      warnings.m4: New file. · 018a4785
      Zack Weinberg authored
      config:
      	* warnings.m4: New file.
      libcpp:
      	* configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
      	programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
      	ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
      	* aclocal.m4, configure: Regenerate.
      	* init.c: Include localedir.h.
      	* Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
      	(DEFS): Delete.
      	(.c.o): Use $(ALL_CFLAGS).
      	(localedir.h, localedir.hs): New rules.
      	(clean): Use rm -rf to remove directories.
      	(distclean): Also delete localedir.h and localedir.hs.
      	(init.o): Update dependencies.
      
      From-SVN: r88074
      018a4785
  12. Jul 23, 2004
  13. Jul 04, 2004
    • Neil Booth's avatar
      re PR preprocessor/16192 (Bug in expression evaluation when operand is missing) · a09d4744
      Neil Booth authored
      	* doc/cpp.texi: Don't document what we do for ill-formed expressions.
      	* doc/cppopts.texi: Clarify processing of command-line defines.
      
      libcpp:
      	PR preprocessor/16192
      	PR preprocessor/15913
      	PR preprocessor/15572
      	* expr.c (_cpp_parse_expr): Handle remaining cases where an
      	expression is missing.
      	* init.c (post_options): Traditional cpp doesn't do // comments.
      
      testsuite:
      	* gcc.dg/cpp/if-mop.c: Two new testcases.
      	* gcc.dg/cpp/trad/comment-3.c: New.
      
      From-SVN: r84080
      a09d4744
  14. Jun 05, 2004
    • Zack Weinberg's avatar
      Makefile.am: Add makedepend. · c6e83800
      Zack Weinberg authored
      libcpp:
      	* Makefile.am: Add makedepend.
      	* Makefile.in, aclocal.m4: Regenerate.
      	* charset.c: Insert a space to avoid a warning.
      	* directives.c: Include mkdeps.h.
      	(_cpp_handle_directive): Reenable macro expander if appropriate.
      	(undefine_macros): Inline body of _cpp_free_definition for speed.
      	Do not call undef callback or _cpp_warn_if_unused_macro.
      	(cpp_get_deps): New interface.
      	* files.c (search_cache): Add pfile argument.  Check for file
      	that would be found by "" or <> search here...
      	(_cpp_find_file): ...not here.  Correct recorded start_dir of
      	files found by directory-of-current-file search that would be
      	found by "" or <> search.
      	* init.c (cpp_add_dependency_target): Delete.
      	* internal.h (struct lexer_state): Add discarding_output flag.
      	* lex.c (lex_identifier): Compute hash function while scanning.
      	* macro.c (cpp_scan_nooutput): Disable macro expansion outside
      	directives.
      	* makedepend.c: New file.
      	* mkdeps.c (struct deps): Add vpath vector.
      	(apply_vpath, deps_add_vpath): New function.
      	(deps_free): Free vpath vector.
      	(deps_add_dep, deps_add_target): Use apply_vpath.
      	* symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
      	(ht_lookup_with_hash): New function.
      	* cpplib.h, mkdeps.h: Update prototypes.
      	* symtab.h: Update prototypes.
      	(HT_HASHSTEP, HT_FINISH): New macros.
      
      gcc:
      	* Makefile.in (MKDEPS_H): New shorthand.
      	(c-opts.o): Update dependencies.
      	* c-opts.c: Include mkdeps.h.
      	(handle_deferred_opts): Use cpp_get_deps and deps_add_target,
      	not cpp_add_dependency_target.
      
      From-SVN: r82654
      c6e83800
  15. May 24, 2004
    • Paolo Bonzini's avatar
      Makefile.def (host_modules): add libcpp. · 4f4e53dd
      Paolo Bonzini authored
      ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	* Makefile.def (host_modules): add libcpp.
      	* Makefile.tpl: Add dependencies on and for libcpp.
      	* Makefile.in: Regenerate.
      	* configure.in: Add libcpp host module.
      	* configure: Regenerate.
      
      config/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	* acx.m4 (ACX_HEADER_STDBOOL, ACX_HEADER_STRING):
      	From gcc.
      
      gcc/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	Move libcpp to the toplevel.
      	* Makefile.in: Remove references to libcpp files,
      	use CPPLIBS instead of libcpp.a.  Define SYMTAB_H
      	and change hashtable.h to that.
      	* aclocal.m4 (gcc_AC_HEADER_STDBOOL,
      	gcc_AC_HEADER_STRING, gcc_AC_C__BOOL): Remove.
      	* configure.ac (gcc_AC_C__BOOL, HAVE_UCHAR): Remove tests.
      	* configure: Regenerate.
      	* config.in: Regenerate.
      	* c-ppoutput.c: Include ../libcpp/internal.h instead of cpphash.h.
      	* cppcharset.c: Removed.
      	* cpperror.c: Removed.
      	* cppexp.c: Removed.
      	* cppfiles.c: Removed.
      	* cpphash.c: Removed.
      	* cpphash.h: Removed.
      	* cppinit.c: Removed.
      	* cpplex.c: Removed.
      	* cpplib.c: Removed.
      	* cpplib.h: Removed.
      	* cppmacro.c: Removed.
      	* cpppch.c: Removed.
      	* cpptrad.c: Removed.
      	* cppucnid.h: Removed.
      	* cppucnid.pl: Removed.
      	* cppucnid.tab: Removed.
      	* hashtable.c: Removed.
      	* hashtable.h: Removed.
      	* line-map.c: Removed.
      	* line-map.h: Removed.
      	* mkdeps.c: Removed.
      	* mkdeps.h: Removed.
      	* stringpool.h: Include symtab.h instead of hashtable.h.
      	* tree.h: Include symtab.h instead of hashtable.h.
      	* system.h (O_NONBLOCK, O_NOCTTY): Do not define.
      
      gcc/cp/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	* Make-lang.in: No need to specify $(LIBCPP).
      
      gcc/java/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	* Make-lang.in: Link in $(LIBCPP) instead of mkdeps.o.
      
      libcpp/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	Moved libcpp from the gcc subdirectory to the toplevel.
      	* Makefile.am: New file.
      	* Makefile.in: Regenerate.
      	* configure.ac: New file.
      	* configure: Regenerate.
      	* config.in: Regenerate.
      	* charset.c: Moved from gcc/cppcharset.c.  Add note about
      	brokenness of input charset detection.  Adjust for change
      	in name of cppucnid.h.
      	* errors.c: Moved from gcc/cpperror.c.  Do not include intl.h.
      	* expr.c: Moved from gcc/cppexp.c.
      	* files.c: Moved from gcc/cppfiles.c.  Do not include intl.h.
      	Remove #define of O_BINARY, it is in system.h.
      	* identifiers.c: Moved from gcc/cpphash.c.
      	* internal.h: Moved from gcc/cpphash.h.  Change header
      	guard name.  All other files adjusted to match name change.
      	* init.c: Moved from gcc/cppinit.c.
      	(init_library) [ENABLE_NLS]: Call bindtextdomain.
      	* lex.c: Moved from gcc/cpplex.c.
      	* directives.c: Moved from gcc/cpplib.c.
      	* macro.c: Moved from gcc/cppmacro.c.
      	* pch.c: Moved from gcc/cpppch.c.  Do not include intl.h.
      	* traditional.c: Moved from gcc/cpptrad.c.
      	* ucnid.h: Moved from gcc/cppucnid.h.  Change header
      	guard name.
      	* ucnid.pl: Moved from gcc/cppucnid.pl.
      	* ucnid.tab: Moved from gcc/cppucnid.tab.  Change header
      	guard name.
      	* symtab.c: Moved from gcc/hashtable.c.
      	* line-map.c: Moved from gcc.  Do not include intl.h.
      	* mkdeps.c: Moved from gcc.
      	* system.h: New file.
      
      libcpp/include/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	* cpplib.h: Moved from gcc.  Change header guard name.
      	* line-map.h: Moved from gcc.  Change header guard name.
      	* mkdeps.h: Moved from gcc.  Change header guard name.
      	* symtab.h: Moved from gcc/hashtable.h.  Change header
      	guard name.
      
      libcpp/po/ChangeLog:
      
      2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
      
      	* be.po: Extracted from gcc/po/be.po.
      	* ca.po: Extracted from gcc/po/ca.po.
      	* da.po: Extracted from gcc/po/da.po.
      	* de.po: Extracted from gcc/po/de.po.
      	* el.po: Extracted from gcc/po/el.po.
      	* es.po: Extracted from gcc/po/es.po.
      	* fr.po: Extracted from gcc/po/fr.po.
      	* ja.po: Extracted from gcc/po/ja.po.
      	* nl.po: Extracted from gcc/po/nl.po.
      	* sv.po: Extracted from gcc/po/sv.po.
      	* tr.po: Extracted from gcc/po/tr.po.
      
      From-SVN: r82199
      4f4e53dd
  16. Apr 23, 2004
    • Per Bothner's avatar
      line-map.h (struct line_maps): New field highest_line. · 500bee0a
      Per Bothner authored
      	* line-map.h (struct line_maps):  New field highest_line.
      	(linemap_position_for_column):  Make non-inline function.
      	(LINEMAP_POSITION_FOR_COLUMN):  New macro.
      	* line-map.c (linemap_init):  Clear highest_line field.
      	(linemap_add):  Set highest_line field.
      	(linemap_line_start):  Minor optimization - use highest_line field.
      	Reduce maximum column hint to 10000.  Update highest_line field.
      	(linemap_position_for_column):  Moved from line-map.h.  Optimize a bit.
      	* cpphash.h (struct cpp_reader):  Remove line field - instead use
      	line_table->highest_line.
      	(saved_line):  Remove unused field.
      	(CPP_INCREMENT_FILE):  Don't do linemap_lookup - just use newest map.
      	Use  line_table's highest_line field instead of cpp_reader's line.
      	* cpplib.c (start_directive):  Likewise use highest_line field.
      	(do_line, do_linemarker):  Likewise just use newest map.
      	(_cpp_do_file_change):  Don't need to set cpp_reader's line field.
      	* cpperror.c (cpp_error):  Likewise use highest_line field.
      	* cppfiles.c (open_file_failed:  Likewise.
      	(cpp_make_system_header):  Likewise use newest map and highest_line.
      	* cppinit.c (cpp_create_reader):  Don't initialize removed field.
      	* cpplex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
      	skip_line_comment, skip_whitespace, _cpp_get_fresh_line,
      	_cpp_lex_direct):  Likewise use highest_line.
      	(_cpp_lex_direct):  Use new LINEMAP_POSITION_FOR_COLUMN macro.
      	* cppmacro.c (_cpp_builtin_macro_text):  Likewise use highest_line,
      	and use newest map.
      	* cpppch.c (cpp_read_state):  Don't save+restore cpp_reader's line.
      	* cpptrad.c (_cpp_overlay_buffer):  Don't save cpp_reader's line.
      	(copy_comment, _cpp_scan_out_logical_line):  Likewise use highest_line.
      
      From-SVN: r81074
      500bee0a
    • Per Bothner's avatar
      re PR preprocessor/15067 (Minor glitch in the source of cpp.) · 3092d0fc
      Per Bothner authored
      	* cppinit.c (cpp_read_main_file):  Return NULL rather than false.
      	Fixes PR preprocessor/15067.
      
      From-SVN: r81068
      3092d0fc
  17. Feb 19, 2004
    • Richard Henderson's avatar
      c-opts.c (warn_variadic_macros): New. · e5b79219
      Richard Henderson authored
              * c-opts.c (warn_variadic_macros): New.
              (c_common_handle_option): Set it.
              (sanitize_cpp_opts): Copy it to cpp_opts.
              * c.opt (Wvariadic-macros): New.
              * cpplib.h (struct cpp_options): Add warn_variadic_macros.
              * cppinit.c (cpp_create_reader): Initialize it.
              * cppmacro.c (parse_params): Check it.
      
      From-SVN: r78125
      e5b79219
  18. Feb 11, 2004
    • Per Bothner's avatar
      Represent column numbers using line-map's source_location. · 12f9df4e
      Per Bothner authored
      	The "next available source_location" is now managed internally by
      	line-maps.c rather than by clients.
      	* line-map.h (struct line_map):  New field column_bits.
      	<from_line>:  Rename field to start_location.
      	(struct line_maps):  New fields highest_location and max_column_hint.
      	(linemap_check_files_exited):  New declaration.
      	(linemap_line_start):  New declaration.
      	(linemap_add):  Remove from_line parameter; use highest_location field.
      	(SOURCE_LINE, LAST_SOURCE_LINE):  Modify to use column_bits.
      	(SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION):  New macros.
      	(CURRENT_LINE_MAP):  Remove macro.
      	(linemap_position_for_column):  New inline function.
      	* line-map.c (linemap_init):  Clear new fields.
      	(linemap_check_files_exited):  New function, extracted from ...
      	(linemap_free):  Use linemap_check_files_exited.
      	(linemap_add):  Remove from_line parameter.  Various updates.
      	(linemap_line_start):  New function.
      	(linemap_lookeup):  Update for new field names.
      	* cpphash.h (struct cpp_reader) <map>:  Field removed.  Because
      	linemap_position_for_column may unpredictably change the current map,
      	it is cleaner and simpler for us to not cache it in cpp_reader.
      	(struct cpp_buffer):  New sysp field.
      	Changed warned_cplusplus_comments and from_stage3 to bitfields.
      	* cppinit.c (cpp_read_min_file):  pfile->map no longer exists.
      	* cpplib.c (do_line, do_linemarker, _cpp_do_file_change):  Get
      	current map using linemap_lookup.
      	(do_linemarker):  Also set buffer's sysp field.
      	(destringize_and_run):  No longer need to decrement current line.
      	* cppfiles.c (_cpp_stack_file):  Set sysp from and in buffer.
      	(search_path_head, open_file_failed):  Use buffer's sysp.
      	(cpp_make_system_header):  Get current map using linemap_lookup.
      	Also set buffer's sysp flag.
      	* cppmacro.c (_cpp_builtin_macro_text):  Likewise use linemap_lookup.
      	* cpphash.h (CPP_INCREMENT_LINE):  New macro.
      	(struct cpp_buffer):  Moved fields saved_cur, saved_rlimit to ...
      	(struct cpp_reader):  ... and adding saved_line_base field.
      	* cpptrad.c (_cpp_overlay_buffer, _cpp_remove_overlay):
      	Update accordingly.  Don't adjust line.
      	(_cpp_scan_out_logical_line):  Use CPP_INCREMENT_LINE.
      	* cpphash.c (CPP_IN_SYSTEM_HEADER):  Replaced macro by ...
      	(cpp_in_system_header):  ... new inline function, using buffer's sysp.
      	* cpperror.c (_cpp_begin_message):  Update to use cpp_in_system_header.
      	* cpplex.c (_cpp_lex_direct):  Likewise.
      	* cppmacro.c (_cpp_builtin_macro_text):  Likewise.
      	* cppmacro.c (_cpp_create_definition):  Use buffer's sysp field.
      	* cpplib.h (struct cpp_token):  Rename line field to src_loc.
      	Remove col field as it is now subsumed by src_loc.
      	* cpperror.c:  Update various field, parameter, and macro names.
      	(print_location):  If col==0, try SOURCE_COLUMN of line.
      	(cpp_error):  Use cur_token's src_loc field, rather than line+col.
      	* cpplib.c (do_diagnostic):  Token's src_loc fields replaces line+col.
      	* cpplex.c (_cpp_process_line_notes, _cpp_lex_direct,
      	_cpp_skip_block_comment):  Use CPP_INCREMENT_LINE.
      	(_cpp_temp_token):  Replace cpp_token's line+col fields by src_loc.
      	(_cpp_get_fresh_line):  Don't need to adjust line for missing newline.
      	(_cpp_lex_direct):  Use linemap_position_for_column.
      	* c-ppoutput.c (maybe_print_line, print_line):  Don't take map
      	parameter.  Instead get it from the line_table global.  Adjust callers.
      	(print):  Remove map field.  Replace line field to src_line.
      	(init_pp_output, account_for_newlines, maybe_print_line):  Adjust.
      	(cb_line_change):  Use SOURCE_COLUMN.  Minor optimizations.
      	(pp_file_change):  Use MAIN_FILE_P since we cannot checked print.map.
      	Use LAST_SOURCE_LINE_LOCATION to "catch up" after #include.
      	* cpptrad.c (copy_comment):  Rename variable.
      	* c-lex.c (map):  Remove static variable, for same reason we removed
      	cpp_reader's map field.
      	(cb_line_change, cb_def_pragma, cb_define, cb_undef):  Hence we need
      	to call linemap_lookup.
      	(cb_line_change):  Token's line field replaced by src_loc.
      	(fe_file_change):  Use MAINFILE_P and LAST_SOURCE_LINE macros.
      	Don't save new_map.
      
      	* cpphash.h, cpperror.c, cpplib.h:  Some renames of fileline to
      	source_location.
      
      From-SVN: r77663
      12f9df4e
  19. Feb 05, 2004
    • Per Bothner's avatar
      Partially revert/redo 2003-10-01 change; fix -fworking-directory. · 8e9ea4d7
      Per Bothner authored
      	* c-ppoutput.c (pp_dir_change):  New function.
      	* c-common.h (pp_dir_change):  New declaration.
      	* cpplib.h (struct cpp_options):  Remove working_directory field.
      	* cppinit.c (cpp_find_main_file, cpp_push_main_file):  Merge back to
      	(cpp_read_main_file):  as before 10-01.  Call _cpp_stack_file.
      	Don't handle -fworking_directory here, but in c_common_post_options.
      	(read_original_directory): Don't back up when done.
      	Don't clear no-longer used working_directory flag.
      	* cpplib.h:  Update declarations to match.
      	* c-lex.c (cb_dir_change):  Move to c-opts.c.
      	(init_c_lex):  Don't set dir_change callback here, since we want
      	to set it even if flag_preprocess_only.
      	* c-opts.c (cb_dir_change):  Function moved from c-lex.c.
      	(c_common_post_options):  Set dir_change callback.
      	Call pp_dir_change if approporiate.
      	(finish_options):  Don't call cpp_find_main_file here.	Hence remove
      	unneeded parameter and result. Do LC_RENAME for <built-in>.
      	(c_common_post_options):  Call cpp_read_main_file here instead.
      	(c_common_init):  Update accordingly.
      	(push_command_line_include):  Don't cpp_push_main_file.
      	Do LC_RENAME rather than LC_LEASE to get back to main file.
      	Compared to pre-10-01 version, inline cpp_rename_to_main_file.
      	(c_common_parse_file):  Call cpp_read_main_file for subsequent main
      	files, but call finish_options for all files.
      	* c-opts.c (sanitize_cpp_opts):  Don't set cpp_opts->working_directory.
      	* fix-header.c (read_scan_file):  Call cpp_read_main_file instead of
      	cpp_find_main_file + cpp_push_main_file.
      	* c-lex.c (fe_file_change):  Don't set main_input_filename here.
      	* opts.c (handle_options):  Only set main_input_filename first time.
      
      From-SVN: r77303
      8e9ea4d7
  20. Feb 02, 2004
    • Eric Christopher's avatar
      [multiple changes] · 16dd5cfe
      Eric Christopher authored
      2004-02-02  Eric Christopher  <echristo@redhat.com>
                  Zack Weinberg  <zack@codesourcery.com>
      
              * c-opts.c (c_common_handle_option): Add -finput-charset.
              * c.opt: Ditto.
              * cppcharset.c (one_iso88591_to_utf8): Remove.
              (convert_iso88591_utf8): Ditto.
              (conversion_tab): Remove 8859-1 converter.
              (_cpp_input_to_utf8): Remove.
              (_cpp_init_iconv_buffer): Ditto.
              (_cpp_close_iconv_buffer): Ditto.
              (_cpp_convert_input): New function.
              (_cpp_default_encoding): Ditto.
              * cpphash.h: Add/remove prototypes for above.
              * cppfiles.c (read_file_guts): Use _cpp_convert_input.
              * cppinit.c (cpp_create_reader): Use _cpp_default_encoding
              for narrow execution and input character sets.
              * cpplib.c (cpp_push_buffer): Delete uses of removed functions.
              * doc/cppopts.texi: Document -finput-charset.
      
      2004-02-02 Eric Christopher  <echristo@redhat.com>
                 Zack Weinberg  <zack@codesourcery.com>
      
              * gcc.c-torture/execute/wchar_t-1.c: Add -finput-charset.
      
      2004-01-29  Eric Christopher  <echristo@redhat.com>
                  Zack Weinberg  <zack@codesourcery.com>
      
              * testsuite/22_locale/collate/compare/wchar_t/2.cc: Remove xfail. Use
              -finput-charset.
              * testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc: Ditto.
              * testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc: Ditto
              * testsuite/22_locale/collate/hash/wchar_t/2.cc: Ditto.
              * testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc: Ditto.
              * testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc: Ditto.
              * testsuite/22_locale/collate/transform/wchar_t/2.cc: Ditto.
              * testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc: Ditto.
              * testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc:
              Ditto.
      
      From-SVN: r77136
      16dd5cfe
  21. Jan 21, 2004
    • Kazu Hirata's avatar
      alias.c, [...]: Update copyright. · d9221e01
      Kazu Hirata authored
      	* alias.c, basic-block.h, c-common.c, c-common.h,
      	c-cppbuiltin.c, c-opts.c, c-pragma.c, c-pretty-print.c,
      	calls.c, cfg.c, cfgcleanup.c, cfgrtl.c, cgraph.h, collect2.c,
      	combine.c, cppcharset.c, cpphash.h, cppinit.c, cpplib.c,
      	cpplib.h, cppmacro.c, crtstuff.c, cselib.c, cselib.h,
      	defaults.h, df.c, dominance.c, et-forest.c, expmed.c, expr.c,
      	expr.h, fix-header.c, function.h, gcc.c, gcse.c, genattrtab.c,
      	genautomata.c, genconditions.c, genemit.c, genflags.c,
      	gengtype.c, gengtype.h, genopinit.c, genrecog.c, gensupport.c,
      	ggc-zone.c, graph.c, haifa-sched.c, input.h, integrate.c,
      	langhooks-def.h, langhooks.c, langhooks.h, line-map.c,
      	line-map.h, local-alloc.c, optabs.c, optabs.h, postreload.c,
      	ra.h, recog.c, reg-stack.c, regmove.c, reload.c, reorg.c,
      	rtl.c, sched-deps.c, sched-ebb.c, sdbout.c, system.h,
      	target.h, targhooks.c, toplev.h, tree-inline.c, unwind-pe.h,
      	unwind.h, varray.c, varray.h: Update copyright.
      
      From-SVN: r76302
      d9221e01
  22. Jan 20, 2004
    • Per Bothner's avatar
      Move cpp_reader's line_maps field to a shared global. · 50f59cd7
      Per Bothner authored
      	* cpphash.h (cpp_reader):  Rename line_maps field to line_table
      	and change the type to a pointer rather than a struct.
      	* cppinit.c (cpp_push_main_field):  Adjust accordingly.
      	* cpplib.c (do_include_common, _cpp_do_file_change, cpp_get_callbacks):
      	Likewise.
      	* cppfiles.c (validate_pch):  Likewise.
      	* cppmacro.c (_cpp_warn_if_unused_macro, _cpp_builtin_macro_text):
      	Likewise.
      	* cpperror.c (print_location):  Likewise.
      	* cpplib.h (cpp_create_reader):  New line_maps pointer parameter.
      	* cppinit.c (cpp_create_reader):  Handle new parameter.
      	(cpp_destroy):  Don't free line_maps - that's no longer our job.
      	* input.h (line_table):  New variable.
      	* toplev.c (line_table):  Declare variable.
      	(general_init):  Initialize line_table.
      	* c-opts.c (c_common_init_options):  Pass line_table to
      	cpp_create_reader.
      	* fix-header.c (read_scan_file):  New local variable line_table.
      	Initialize, and pass it to cpp_create_reader.
      	* Makefile.in (LIBS, LIBDEPS):  Add libcpp.a.
      	(C_AND_OBJC_OBJS, fix-header):  Remove redundant libcpp.a.
      
      From-SVN: r76198
      50f59cd7
  23. Jan 16, 2004
    • Eric Christopher's avatar
      cppcharset.c (one_iso88591_to_utf8): New function. · cf551fba
      Eric Christopher authored
      2004-01-16  Eric Christopher  <echristo@redhat.com>
      	    Chandrakala Chavva <cchavva@redhat.com>
      
      	* cppcharset.c (one_iso88591_to_utf8): New function.
      	(convert_iso88591_utf8): Ditto. Use.
      	(conversion_tab): Use.
      	(_cpp_input_to_utf8): New function.
      	(_cpp_init_iconv_buffer): Ditto.
      	(_cpp_close_iconv_buffer): Ditto.
      	* cpphash.h: Prototype new functions.
      	(cpp_buffer): Add input_cset_desc.
      	* cppinit.c: Add input_charset default.
      	* cpplib.c (cpp_push_buffer): Support init and
      	close of iconv.
      	* cpplib.h (cpp_options): Add input_charset.
      
      From-SVN: r76000
      cf551fba
  24. Nov 01, 2003
    • John David Anglin's avatar
      re PR preprocessor/12847 (xxx.c:1:20: xxxx.h: No such file or directory) · 0527bc4e
      John David Anglin authored
      	PR preprocessor/12847
      	* cppfiles.c, cppexp.c, cpperror.c, cpplib.h, cpplib.c, cpplex.c,
      	cppinit.c, cpptrad.c, cppmacro.c, fix-header.c, cpppch.c, c-pch.c,
      	c-incpath.c, cppcharset.c (DL_WARNING, DL_WARNING_SYSHDR, DL_PEDWARN,
      	DL_ERROR, DL_ICE, DL_EXTRACT, DL_WARNING_P): Prefix macro names with
      	"CPP_".
      
      From-SVN: r73183
      0527bc4e
  25. Oct 02, 2003
    • Per Bothner's avatar
      cppinit.c (cpp_read_main_file): Split into two functions: Distribute... · 4dc299fb
      Per Bothner authored
      cppinit.c (cpp_read_main_file): Split into two functions: Distribute _cpp_stack_file call over the two functions.
      
      
      	* cppinit.c (cpp_read_main_file):  Split into two functions:
      	Distribute _cpp_stack_file call over the two functions.
      	(cpp_find_main_file):  New function.
      	Don't call _cpp_do_file_change even if working_directory flag set.
      	(cpp_push_main_file):  New function.
      	* cppfiles.c (_cpp_find_failed):  New helper function.
      	(find_file):  Made non-static and renamed to _cpp_find_file.
      	(_cpp_stack_file):  No longer needed.  But note the following.
      	(stack_file):  Made non-static and renamed to _cpp_stack_file.
      	* fix-header.c (cpp_read_main_file):  Replace cpp_read_main_file
      	call with calls to cpp_find_main_file and cpp_push_main_file.
      	(search_path_head):  If there is no current buffer, use main_file.
      	* cpphash.h:  Update function declarations.
      	* cpplib.h:  Update function declarations.
      
      From-SVN: r72014
      4dc299fb
  26. Aug 19, 2003
    • Kazu Hirata's avatar
      c-common.c: Fix comment formatting. · 59e4e217
      Kazu Hirata authored
      	* c-common.c: Fix comment formatting.
      	* c-common.h: Likewise.
      	* c-decl.c: Likewise.
      	* cppinit.c: Likewise.
      	* cpplib.h: Likewise.
      	* emit-rtl.c: Likewise.
      	* input.h: Likewise.
      	* line-map.h: Likewise.
      	* opts.c: Likewise.
      	* opts.h: Likewise.
      	* simplify-rtx.c: Likewise.
      
      From-SVN: r70577
      59e4e217
  27. Aug 11, 2003
  28. Aug 09, 2003
    • Per Bothner's avatar
      cppinit.c (cpp_read_main_file): Split out source-independent initialization to... · 4169c321
      Per Bothner authored
      cppinit.c (cpp_read_main_file): Split out source-independent initialization to separate function ...
      
      
              * cppinit.c (cpp_read_main_file):  Split out source-independent
              initialization to separate function ...
              (cpp_post_options):  New function.
              * cppfiles.c (cpp_stack_file):  Rename public name to ...
              (_cpp_stack_file):  New internal function name.
              * cpplib.h:  Update accordingly.
              * cppinit.c:  (cpp_create_reader):  Initialize cpp_readers line here.
              (cpp_read_main_file):  Don't initialize line here.
              * c-opts.c (c_common_post_options):  Call cpp_post_options.
              (c_common_parse_file):  Call cpp_read_main_file, not cpp_stack_file.
              * fix-header.c (read_scan_file):  Call cpp_post_options.
      
      From-SVN: r70279
      4169c321
  29. Aug 05, 2003
    • Alexandre Oliva's avatar
      c.opt: Introduce -fworking-directory. · b20d9f0c
      Alexandre Oliva authored
      * c.opt: Introduce -fworking-directory.
      * doc/cpp.texi, doc/invoke.texi, doc/cppopts.texi: Document it.
      * c-common.h (flag_working_directory): Declare.
      * c-common.c (flag_working_directory): Define.
      * c-opts.c (c_common_handle_options): Set it.
      (sanitize_cpp_opts): Set...
      * cpplib.h (struct cpp_options): ... working_directory option.
      (struct cpp_callbacks): Add dir_change.
      * cppinit.c (read_original_filename): Call...
      (read_original_directory): New.  Look for # 1 "directory//"
      and process it.
      (cpp_read_main_file): Call dir_change callback if working_directory
      option is set.
      * gcc.c (cpp_unique_options): Pass -g*.
      * c-lex.c (cb_dir_change): New.
      (init_c_lex): Set dir_change callback.
      * toplev.c (src_pwd): New static variable.
      (set_src_pwd, get_src_pwd): New functions.
      * toplev.h (get_src_pwd, set_src_pwd): Declare.
      * dbxout.c (dbxout_init): Call get_src_pwd() instead of getpwd().
      * dwarf2out.c (gen_compile_unit_die): Likewise.
      * dwarfout.c (output_compile_unit_die, dwarfout_init): Likewise.
      
      From-SVN: r70189
      b20d9f0c
  30. Aug 01, 2003
    • Neil Booth's avatar
      Makefile.in: Refine dependencies. · bf42e45b
      Neil Booth authored
      	* Makefile.in: Refine dependencies.
      	* c-opts.c (c_common_handle_option): Do nothing for -Wimport.
      	* c.opt: Update help for -Wimport.
      	* cppfiles.c: Include hashtab.h.  Update comments.
      	(stack_file): Read the file before updating dependencies.
      	(once_only_file_p): Be smarter about marking once-only files.
      	(_cpp_mark_file_once_only): Correct the check for existence on
      	the list.
      	(open_file_failed): Use name not path, which is NULL.
      	* cpphash.h: Don't include hashtab.h.
      	(struct _cpp_file): Remove.
      	(struct cpp_reader): Update.
      	* cppinit.c (cpp_create_reader): Don't initialize warn_import.
      	* cpplib.h (struct cpp_options): Remove warn_import.
      	(cpp_simplify_path): Remove.
      
      From-SVN: r70045
      bf42e45b
  31. Jul 29, 2003
    • Neil Booth's avatar
      Makefile.in (LIBCPP_DEPS): Add HASHTAB_H. · 8f9b4009
      Neil Booth authored
      	* Makefile.in (LIBCPP_DEPS): Add HASHTAB_H.
      	* cppfiles.c: Completely rewritten.
      	* c-incpath.c (free_path, remove_duplicates, heads, tails, add_path):
      	struct cpp_path is now struct cpp_dir.
      	(remove_duplicates): Don't simplify path names.
      	* c-opts.c (c_common_parse_file): cpp_read_next_file renamed
      	cpp_stack_file.
      	* cpphash.h: Include hashtab.h.
      	(_cpp_file): Declare.
      	(struct cpp_buffer): struct include_file is now struct _cpp_file,
      	and struct cpp_path is now struct cpp_dir.  Rename members.
      	(struct cpp_reader): Similarly.  New members once_only_files,
      	file_hash, file_hash_entries, quote_ignores_source_dir,
      	no_search_path, saw_pragma_once.  Remove all_include_files and
      	max_include_len.  Make some members bool.
      	(_cpp_mark_only_only): Renamed from _cpp_never_reread.
      	(_cpp_stack_file): Renamed from _cpp_read_file.
      	(_cpp_stack_include): Renamed from _cpp_execute_include.
      	(_cpp_init_files): Renamed from _cpp_init_includes.
      	(_cpp_cleanup_files): Renamed from _cpp_cleanup_includes.
      	* cppinit.c (cpp_create_reader): Initialize no_search_path.  Update.
      	(cpp_read_next_file): Rename and move to cppfiles.c.
      	(cpp_read_main_file): Update.
      	* cpplib.c (run_directive): Update for renamed members.
      	(do_include_common, _cpp_pop_buffer): Update.
      	(do_import): Undeprecate #import.
      	(do_pragma_once): Undeprecate.  Use _cpp_mark_file_once_only.
      	* cpplib.h: Remove file_name_map_list.
      	(cpp_options): Remove map_list.
      	(cpp_dir): Rename from cpp_path.  New datatype for name_map.
      	(cpp_set_include_chains, cpp_stack_file, cpp_included): Update.
      testsuite:
      	* gcc.dg/cpp/include2.c: Only expect one message.
      
      From-SVN: r69942
      8f9b4009
  32. Jul 22, 2003
    • Zack Weinberg's avatar
      hashtable.c (approx_sqrt): Make static. · a2f7be91
      Zack Weinberg authored
      	* hashtable.c (approx_sqrt): Make static.
      	* hashtable.h: Don't prototype approx_sqrt.
      	* line-map.c (init_line_maps): Rename linemap_init.
      	(free_line_maps): Rename linemap_free.
      	(add_line_map): Rename linemap_add.
      	(lookup_line): Rename linemap_lookup.
      	(print_containing_files): Rename linemap_print_containing_files.
      	* linemap.h: Update to match.
      
      	* cpperror.c, cppinit.c, cpplib.c, cppmacro.c: Update calls to
      	linemap routines to use new names.
      
      From-SVN: r69672
      a2f7be91
  33. Jul 19, 2003
    • Kaveh R. Ghazi's avatar
      alias.c [...]: Remove unnecessary casts. · 703ad42b
      Kaveh R. Ghazi authored
      	* alias.c alloc-pool.c bitmap.c bitmap.h bt-load.c builtins.c
      	c-common.c c-decl.c c-incpath.c c-lex.c c-opts.c c-parse.in
      	c-pragma.c c-typeck.c calls.c cfg.c cfganal.c cfgloop.c cfgrtl.c
      	collect2.c combine.c conflict.c coverage.c cppexp.c cppfiles.c
      	cpphash.c cppinit.c cpplex.c cpplib.c cppmacro.c cppspec.c
      	cpptrad.c cse.c cselib.c dbxout.c defaults.h df.c dominance.c
      	dwarf2out.c dwarfout.c emit-rtl.c except.c expmed.c expr.c final.c
      	fix-header.c flow.c fold-const.c function.c gcc.c gccspec.c gcov.c
      	gcse.c genattr.c genattrtab.c genautomata.c genconditions.c
      	genemit.c genextract.c genoutput.c genrecog.c gensupport.c
      	ggc-page.c ggc-simple.c global.c graph.c haifa-sched.c hashtable.c
      	integrate.c jump.c langhooks.c lcm.c line-map.c local-alloc.c
      	loop.c mips-tdump.c mips-tfile.c mkdeps.c optabs.c params.c
      	postreload.c prefix.c print-tree.c protoize.c ra-build.c
      	ra-colorize.c ra-rewrite.c ra.c recog.c reg-stack.c regclass.c
      	regmove.c regrename.c reload.c reload1.c reorg.c resource.c
      	sbitmap.c sched-deps.c sched-rgn.c sched-vis.c sdbout.c
      	simplify-rtx.c ssa-ccp.c ssa.c stmt.c stor-layout.c timevar.c
      	tlink.c toplev.c tree-dump.c tree.c unroll.c unwind-dw2-fde.c
      	varasm.c varray.c vmsdbgout.c xcoffout.c: Remove unnecessary
      	casts.
      
      From-SVN: r69587
      703ad42b
  34. Jul 13, 2003
    • Zack Weinberg's avatar
      Makefile.in (LIBCPP_DEPS): Remove coretypes.h and $(TM_H). · 43839642
      Zack Weinberg authored
      	* Makefile.in (LIBCPP_DEPS): Remove coretypes.h and $(TM_H).
      	(hashtable.o, line-map.o, mkdeps.o): Likewise, from dependency
      	list.  Move these all together down by cpplib.
      
      	* cpplib.h: Don't refer to MAX_WCHAR_TYPE_SIZE when determining
      	definition of CPPCHAR_SIGNED_T.
      
      	* cppcharset.c, cpperror.c, cppexp.c, cppfiles.c, cpphash.c, cppinit.c
      	* cpplex.c, cpplib.c, cppmacro.c, cpppch.c, cpptrad.c, hashtable.c
      	* line-map.c, mkdeps.c: Don't include coretypes.h or tm.h.
      
      	* cpphash.c (_cpp_init_hashtable): Don't use gcc_obstack_init.
      	* cppinit.c (cpp_create_reader): Likewise.
      
      	* cpphash.h (scan_out_logical_line): Rename _cpp_scan_out_logical_line.
      	* cpptrad.c: Likewise.  All callers changed.
      	* cpplib.c: All callers changed.
      	* c-ppoutput.c: Replace 'uchar' with 'unsigned char' throughout.
      	* hashtable.h: Define GTY(x) to nothing here too.
      
      From-SVN: r69298
      43839642
  35. Jul 11, 2003
    • Geoffrey Keating's avatar
      Index: ChangeLog · d1bd0ded
      Geoffrey Keating authored
      2003-07-10  Geoffrey Keating  <geoffk@apple.com>
      
      	* c-decl.c (finish_decl): Handle 'used' here...
      	* cgraphunit.c (cgraph_finalize_function): ... and here ...
      	* c-common.c: (handle_used_attribute): ... not here.
      
      	* configure.in (onstep): Support --enable-intermodule.
      	* Makefile.in (OBJS-common): New.
      	(OBJS-md): New.
      	(OBJS-archive): New.
      	(OBJS): Build from OBJS-common, OBJS-md, OBJS-archive.
      	(OBJS-onestep): New.
      	(libbackend.a): Support @onestep@.
      	(libbackend.o): New.
      	* configure: Regenerate.
      
      	* c-common.h (c_reset_state): New prototype.
      	(c_parse_file): New prototype.
      	(finish_file): Move prototype from c-tree.h.
      	* c-decl.c: Include <hashtab.h>.
      	(builtin_decls): New.
      	(current_file_decl): New.
      	(duplicate_decls): Add extra parameter. Change all callers.  Don't
      	output duplicate common symbols.
      	(link_hash_hash): New.
      	(link_hash_eq): New.
      	(poplevel): Handle popping of the top level.
      	(warn_if_shadowing): Handle TRANSLATION_UNIT_DECL.
      	(pushdecl): Set DECL_CONTEXT to TRANSLATION_UNIT_DECL if appropriate.
      	(pushdecl_top_level): Likewise.
      	(redeclaration_error_message): Handle TRANSLATION_UNIT_DECL.
      	(c_init_decl_processing): Create TRANSLATION_UNIT_DECL.
      	(finish_decl): Handle TRANSLATION_UNIT_DECL.
      	(merge_translation_unit_decls): New.
      	(c_write_global_declarations): New.
      	(c_reset_state): New.
      	(implicitly_declare): Handle TRANSLATION_UNIT_DECL.
      	* c-lang.c (LANG_HOOKS_WRITE_GLOBALS): New.
      	* c-objc-common.c (c_cannot_inline_tree_fn): Handle
      	TRANSLATION_UNIT_DECL.
      	(c_objc_common_finish_file): Call merge_translation_unit_decls.
      	* c-opts.c (in_fnames): Rename from in_fname.
      	(c_common_decode_option): Handle multiple input filenames.
      	(c_common_post_options): Likewise.
      	(c_common_parse_file): Likewise; also, call c_parse_file rather than
      	yyparse.
      	* c-parse.in: Move cleanup code to c_parse_file.
      	(free_parser_stacks): Move contents to c_parse_file.
      	(c_parse_file): New.
      	* c-tree.h (union lang_tree_node): Chain along TYPE_NEXT_VARIANT
      	for integer types.
      	(C_DECL_FILE_SCOPE): New.
      	(finish_file): Move prototype to c-common.h.
      	(merge_translation_unit_decls): New prototype.
      	(comptypes): Add extra parameter to prototype.
      	(c_write_global_declarations): New prototype.
      	* c-typeck.c (tagged_types_tu_compatible_p): New.
      	(function_types_compatible_p): Add extra parameter, change all callers.
      	(type_lists_compatible_p): Likewise.
      	(comptypes): Likewise.
      	(struct tagged_tu_seen): New.
      	(tagged_tu_seen_base): New.
      	(build_unary_op): Handle TRANSLATION_UNIT_DECL.
      	(c_mark_addressable): Remove #if 0 code.
      	* calls.c (special_function_p): Handle TRANSLATION_UNIT_DECL, add
      	comment explaining why it shouldn't have to.
      	* cgraph.h (struct cgraph_node): Add chain_next and chain_prev GTY
      	options.
      	* cppinit.c (cpp_read_next_file): New.
      	(cpp_read_main_file): Use it.
      	* cpplib.c (undefine_macros): New.
      	(cpp_undef_all): New.
      	* cpplib.h (cpp_read_next_file): Prototype.
      	(cpp_undef_all): Prototype.
      	* langhooks-def.h (write_global_declarations): Remove prototype.
      	* toplev.h (write_global_declarations): Add prototype.
      	* tree.c (decl_type_context): Use switch statement, handle
      	TRANSLATION_UNIT_DECL.
      	* tree.def: Update documentation for TRANSLATION_UNIT_DECL.
      	(TRANSLATION_UNIT_DECL): New kind of tree.
      	* tree.h: Update documentation for TRANSLATION_UNIT_DECL.
      	* Makefile.in (c-decl.o): Add $(HASHTAB_H) to dependencies.
      	* doc/invoke.texi: Make attempt to document new functionality.
      
      	2003-05-19  Per Bothner <bothner@apple.com>
      
      	* gcc.c (combine_inputs): New.
      	(process_command): Set combine_inputs.
      	(do_spec_1): Handle combine_inputs.
      	(main): Likewise.
      
      Index: cp/ChangeLog
      2003-07-10  Geoffrey Keating  <geoffk@apple.com>
      
      	* decl.c (cp_finish_decl): Handle 'used' attribute.
      
      	* cp-lang.c (c_reset_state): New dummy routine.
      	* cp-tree.h (finish_file): Move prototype to c-common.h.
      	* parser.c (c_parse_file): Rename from yyparse; don't call finish_file.
      
      From-SVN: r69224
      d1bd0ded
  36. Jul 05, 2003
    • Zack Weinberg's avatar
      cpplib.h (CPP_AT_NAME, [...]): New token types. · e6cc3a24
      Zack Weinberg authored
      	* cpplib.h (CPP_AT_NAME, CPP_OBJC_STRING): New token types.
      	(struct cpp_options): Add narrow_charset, wide_charset,
      	bytes_big_endian fields.  Remove EBCDIC field.
      	(cpp_init_iconv, cpp_interpret_string): New external interfaces.
      
      	* cpphash.h: Include <iconv.h> if we have it, otherwise
      	provide a dummy definition of iconv_t.
      	(struct cpp_reader): Add narrow_cset_desc and wide_cset_desc fields.
      	(_cpp_valid_ucn): Update prototype.
      	(_cpp_destroy_iconv): New prototype.
      
      	* doc/cpp.texi: Document character set handling.
      	* doc/cppopts.texi: Document -fexec-charset= and -fexec-wide-charset=.
      	* doc/extend.texi: Delete entire section on multiline strings.
      	Rewrite section on __FUNCTION__ etc now that these are
      	variables in C.
      
      	* cppucnid.tab, cppucnid.pl: New files.
      	* cppucnid.h: New generated file.
      	* cppcharset.c: Include cppucnid.h.  Lots of commentary added.
      	(iconv_open, iconv, iconv_close): Provide dummy definitions
      	if !HAVE_ICONV.
      	(SOURCE_CHARSET, struct strbuf, init_iconv_desc, cpp_init_iconv,
      	_cpp_destroy_iconv, convert_cset, width_to_mask, convert_ucn,
      	emit_numeric_escape, convert_hex, convert_oct, convert_escape,
      	cpp_interpret_string, narrow_str_to_charconst,
      	wide_str_to_charconst): New.
      	(ucn_valid_in_identifier): Use a binary search through the
      	ucnranges table defined in cppucnid.h, not a long chain of if
      	statements.
      	(_cpp_valid_ucn): Add a limit pointer.  Downgrade "universal
      	character names are only valid in C++ and C99" to a warning.
      	Issue the "meaning of \[uU] is different in traditional C"
      	warning here.  Take care not to let iconv see an invalid UCS
      	value if we get a malformed UCN.  Issue an error if we don't
      	have iconv.
      	(cpp_interpret_charconst): Moved here from cpplex.c.  Use
      	cpp_interpret_string to do the heavy lifting.
      
      	* cppinit.c (cpp_create_reader): Initialize bytes_big_endian,
      	narrow_charset, wide_charset fields of options structure.
      	(cpp_destroy): Call _cpp_destroy_iconv.
      	* cpplex.c (forms_identifier_p): Adjust call to _cpp_valid_ucn.
      	(maybe_read_ucn, hex_digit_value, cpp_parse_escape): Delete.
      	(cpp_interpret_charconst): Moved to cppcharset.c.
      	* cpplib.c (dequote_string): Delete.
      	(interpret_string_notranslate): New.
      	(do_line, do_linemarker): Use interpret_string_notranslate.
      
      	* Makefile.in (cppcharset.o): Depend on cppucnid.h.
      
      	* c-common.c (fname_string, combine_strings): Delete.
      	* c-common.h (fname_string, combine_strings): Delete prototypes.
      	* c-lex.c (ignore_escape_flag): Delete.
      	(cb_ident): Use cpp_interpret_string, not lex_string.
      	(get_nonpadding_token): New function.
      	(c_lex): Handle Objective-C @-prefixed identifiers and strings here.
      	Adjust calls to lex_string.  Don't write *value twice.
      	(lex_string): Now handles string constant concatenation.
      	Most of the work handed off to cpp_interpret_string.
      	Call fix_string_type here.
      	* c-parse.in (STRING_FUNC_NAME, VAR_FUNC_NAME): Replace with
      	FUNC_NAME, throughout.
      	(OBJC_STRING): New token type.
      	(primary:STRING): No need to call fix_string_type here.
      	(primary:objc_string): Make that OBJC_STRING.
      	(objc_string nonterminal): Delete.
      	(yylexname): Delete code to handle fake string constants.
      	(yylexstring): Delete entirely.
      	(_yylex): Handle CPP_AT_NAME and CPP_OBJC_STRING.  No need
      	to handle CPP_ATSIGN.
      
      	* c.opt (-fexec-charset=, -fwide-exec-charset=): New options.
      	* c-opts.c (missing_arg, c_common_handle_option): Handle
      	OPT_fexec_charset_ and OPT_fwide_exec_charset_.
      	(c_common_init): Set cpp_opts->bytes_big_endian, not
      	cpp_opts->EBCDIC.  Call cpp_init_iconv.
      	(print_help): Document -fexec-charset= and -fexec-wide-charset=.
      	(TARGET_EBCDIC): Delete default definition.
      
      	* objc/objc-act.c (build_objc_string_object): No need to
      	handle string constant concatenation.
      
      cp:
      	* parser.c (cp_lexer_read_token): No need to handle string
      	constant concatenation.
      
      testsuite:
      	* gcc.c-torture/execute/wchar_t-1.x: New file; XFAIL wchar_t-1.c
      	everywhere.
      	* gcc.dg/concat.c: Concatenation of string constants with
      	__FUNCTION__ / __PRETTY_FUNCTION__ is now a hard error.
      	* gcc.dg/wtr-strcat-1.c: Loosen dg-warning regexp.
      	* gcc.dg/cpp/escape-2.c: Use wide character constants where
      	necessary to avoid multi-character character constant warning.
      	* gcc.dg/cpp/escape.c: Likewise.
      	* gcc.dg/cpp/ucs.c: Likewise.
      	Remove backslashes from dg-bogus comments, as they confuse Tcl.
      	Fix a typo.
      
      libstdc++-v3:
      	* testsuite/22_locale/collate/compare/wchar_t/2.cc
      	* testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc
      	* testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc
      	* testsuite/22_locale/collate/hash/wchar_t/2.cc
      	* testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc
      	* testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc
      	* testsuite/22_locale/collate/transform/wchar_t/2.cc
      	* testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc
      	* testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc:
      	XFAIL on all targets.
      
      From-SVN: r68952
      e6cc3a24
  37. Jun 17, 2003
    • Zack Weinberg's avatar
      * cpplib.h, cpphash.h, cppcharset.c, cpperror.c, cppexp.c · 6cf87ca4
      Zack Weinberg authored
      	* cppfiles.c, cpphash.c, cppinit.c, cpplex.c, cpplib.c
      	* cppmacro.c, cpppch.c, cpptrad.c, cppspec.c: Convert to
      	ISO C: new-style function declarations, no need for PARAMS,
      	no special punctuation on indirect function calls, use string
      	constant concatenation where convenient.
      
      From-SVN: r68070
      6cf87ca4
  38. Jun 16, 2003
    • Kaveh R. Ghazi's avatar
      decl.c, [...]: Don't use the PTR macro. · fad205ff
      Kaveh R. Ghazi authored
      cp:
      	* cp/decl.c, cp/pt.c, cp/search.c, cp/tree.c: Don't use the PTR
      	macro.
      
      gcc:
      	* bitmap.c, builtins.c, c-incpath.c, cgraph.c, config/frv/frv.c,
      	config/mips/mips.c, cppfiles.c, cpphash.c, cppinit.c, cpplib.c,
      	dwarf2out.c, dwarfout.c, except.c, expr.c, expr.h, fold-const.c,
      	function.c, gcc.c, genoutput.c, gensupport.c, global.c,
      	haifa-sched.c, hashtable.c, ifcvt.c, integrate.c, local-alloc.c,
      	loop.c, mips-tdump.c, mips-tfile.c, mkdeps.c, protoize.c,
      	read-rtl.c, recog.h, reload1.c, sbitmap.c, ssa-dce.c,
      	stringpool.c, tlink.c, tree.c, varasm.c, varray.c: Don't use
      	the PTR macro.
      
      From-SVN: r68043
      fad205ff
  39. Jun 12, 2003
    • Hans-Peter Nilsson's avatar
      Don't warn on dollars in builtin macro definitions, · 78b8811a
      Hans-Peter Nilsson authored
      	e.g. __REGISTER_PREFIX__.
      	* cpphash.h (struct cpp_reader): Move member warn_dollars...
      	* cpplib.h (struct cpp_options): ...to here.  Change type to
      	unsigned char.
      	* cppinit.c (cpp_create_reader): Set it to 1 here.
      	(post_options): Don't set it here.
      	* c-opts.c (c_common_init_options): Reset it to 0 here.
      	(finish_options): Set it here.
      	* cpplex.c (forms_identifier_p): Tweak for new location of
      	warn_dollars.
      
      From-SVN: r67824
      78b8811a
Loading