Skip to content
Snippets Groups Projects
  1. Jan 02, 2005
  2. Sep 09, 2004
    • zack's avatar
      2004-09-09 Matt Austern <austern@apple.com> · d6d3c909
      zack authored
      	    Zack Weinberg  <zack@codesourcery.com>
      
      	* include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
      	prefixes throughout.  Add entry for PRAGMA.  Remove
      	unnecessary "= 0" from EQ.
      	(enum cpp_ttype): Adjust OP and TK definitions to restore
      	prefixes, via token-paste.
      	(CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
      	Change from #defines to additional cpp_ttype enumerators.
      	(struct cpp_options): Add defer_pragmas.
      	(cpp_handle_deferred_pragma): Prototype new interface.
      
      	* internal.h (struct cpp_reader): Add directive_result.
      	* directives.c (struct pragma_entry): Add is_internal field;
      	give boolean fields type bool.
      	(start_directive): Initialize pfile->directive_result.type.
      	(_cpp_do__Pragma): Likewise.
      	(run_directive): Do not crash if pfile->buffer->prev is NULL.
      	(insert_pragma_entry): Add 'internal' argument; set new->is_internal
      	from it.
      	(register_pragma): New static function, bulk of former
      	cpp_register_pragma here; add 'internal' argument, pass along
      	to insert_pragma_entry.
      	(cpp_register_pragma): Now a wrapper around register_pragma which
      	always passes false for 'internal' argument.
      	(_cpp_init_internal_pragmas): Call register_pragma directly, passing
      	true for 'internal'.
      	(do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
      	an internal pragma, save text till the end of the line as a CPP_PRAGMA
      	token instead of executing the pragma.
      	(cpp_handle_deferred_pragma): New interface.
      	* lex.c (token_spellings): Adjust OP and TK definitions to
      	match changes to cpplib.h.
      	(_cpp_lex_token): Check for a directive-result token and
      	return it if present.
      	(cpp_token_val_index): Handle CPP_PRAGMA.
      	* macro.c (cpp_builtin_macro_text): Correct comment.
      	(builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87247 138bc75d-0d04-0410-961f-82ee72b054a4
      d6d3c909
  3. Jul 24, 2004
  4. Jun 09, 2004
    • geoffk's avatar
      Index: gcc/ChangeLog · c39ed964
      geoffk authored
      2004-06-09  Geoffrey Keating  <geoffk@apple.com>
      
      	* Makefile.in (CPPLIB_H): Put files in order of inclusion.
      	(CPP_ID_DATA_H): New.
      	(gtype-desc.o): Update dependencies.
      	(GTFILES): Use CPP_ID_DATA_H.
      
      Index: gcc/testsuite/ChangeLog
      2004-06-09  Geoffrey Keating  <geoffk@apple.com>
      
      	* gcc.dg/pch/macro-4.c: New.
      	* gcc.dg/pch/macro-4.hs: New.
      
      Index: libcpp/ChangeLog
      2004-06-09  Geoffrey Keating  <geoffk@apple.com>
      
      	* traditional.c (push_replacement_text): Set macro->traditional.
      	(save_replacement_text): Likewise.
      	* pch.c (cpp_write_pch_state): Don't write list of defined macros.
      	(struct save_macro_item): Delete.
      	(struct save_macro_data): Use a character array not the previous
      	structured format.
      	(save_macros): Save macro as text not as internal structures.
      	(cpp_prepare_state): Update for changes to save_macro_data.
      	(cpp_read_state): Don't read macros defined in PCH.  Restore
      	-D macros as text.
      	* macro.c (create_iso_definition): Honour alloc_subobject.
      	Clear traditional flag.
      	(_cpp_create_definition): Honour alloc_subobject.
      	* lex.c (cpp_token_val_index): New.
      	* internal.h: Include cpp-id-data.h.
      	(uchar): Move definition to cpp-id-data.h.
      	(U): Likewise.
      	(cpp_macro): Likewise.
      	* directives.c (struct answer): Move to cpp-id-data.h.
      	(do_assert): Honour alloc_subobject.
      
      Index: libcpp/include/ChangeLog
      2004-06-09  Geoffrey Keating  <geoffk@apple.com>
      
      	* symtab.h (struct ht): Add field 'alloc_subobject'.
      	* cpplib.h (struct cpp_string): Add GTY marker.
      	(enum cpp_token_fld_kind): New.
      	(struct cpp_token): Add GTY markers.
      	(cpp_token_val_index): Prototype.
      	(CPP_HASHNODE_VALUE_IDX): New.
      	(struct cpp_hashnode): Don't skip fields of 'value' when marking.
      	* cpp-id-data.h: New file.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82851 138bc75d-0d04-0410-961f-82ee72b054a4
      c39ed964
  5. Jun 05, 2004
    • zack's avatar
      libcpp: · 3eb3f293
      zack authored
      	* 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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82654 138bc75d-0d04-0410-961f-82ee72b054a4
      3eb3f293
  6. May 24, 2004
    • bonzini's avatar
      ChangeLog: · d856c8a6
      bonzini authored
      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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82199 138bc75d-0d04-0410-961f-82ee72b054a4
      d856c8a6
  7. Apr 23, 2004
    • bothner's avatar
      · dbddc569
      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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81074 138bc75d-0d04-0410-961f-82ee72b054a4
      dbddc569
  8. Feb 19, 2004
    • rth's avatar
      * c-opts.c (warn_variadic_macros): New. · 05d51900
      rth authored
              (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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78125 138bc75d-0d04-0410-961f-82ee72b054a4
      05d51900
  9. Feb 18, 2004
    • bothner's avatar
      · 6e04daf1
      bothner authored
      	* cpphash.h (struct cpp_buffer):  Restore return_at_eof field.  This
      	partly reverts my 2003-10-01 change, because we're back to logically
      	including <command line> inside the main line.
      	* cpplex.c (_cpp_get_fresh_line):  Check return_at_eof field.
      	* cppmacro.c (cpp_scan_nooutput):  Set return_at_eof of current buffer.
      	Fixes PR preprocessor/14103.
      
      	* cppfiles.c (_cpp_stack_include):  When appropriate decrement
      	line_table's highest_location, fixing LAST_SOURCE_LINE_LOCATION.
      	(cpp_push_include):  Don't need to increment pfile's line field.
      	* line-map.h (LAST_SOURCE_LINE_LOCATION):  Only decrement by 1.
      
      	* c-ppoutput.c (print struct):  New first_time field.
      	(init_pp_output):  Set print.first_time.
      	(pp_file_change):  Use print.first_time, rather than MAIN_FILE_P,
      	which is set also for (say) <command line>.  Clear print.first_time.
      
      	* cppfiles.c (struct _cpp_file):  Comment and type for pch field
      	does not match the code, so fix both.
      	(should_stack_file):  Inline include_pch_p function.
      	(include_pch_p):  Remove pointless function.
      
      	* cpphash.h (struct cpp_buffer):  Remove unused search_cached field.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78049 138bc75d-0d04-0410-961f-82ee72b054a4
      6e04daf1
  10. Feb 11, 2004
    • bothner's avatar
      · 610625e3
      bothner authored
      	Represent column numbers using line-map's source_location.
      	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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77663 138bc75d-0d04-0410-961f-82ee72b054a4
      610625e3
  11. Jan 21, 2004
    • kazu's avatar
      * alias.c, basic-block.h, c-common.c, c-common.h, · a8349c62
      kazu authored
      	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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76302 138bc75d-0d04-0410-961f-82ee72b054a4
      a8349c62
  12. Jan 20, 2004
    • bothner's avatar
      · ceec9c13
      bothner authored
      	Move cpp_reader's line_maps field to a shared global.
      	* 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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76198 138bc75d-0d04-0410-961f-82ee72b054a4
      ceec9c13
  13. Nov 01, 2003
    • danglin's avatar
      PR preprocessor/12847 · d80d2074
      danglin authored
      	* 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_".
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73183 138bc75d-0d04-0410-961f-82ee72b054a4
      d80d2074
  14. Oct 02, 2003
    • bothner's avatar
      · 9eb74666
      bothner authored
      	* cpplib.c (_cpp_pop_buffer):  Do generate a _cpp_do_file_change
      	callback even when popping the main file.
      
      	* cpplib.c (cpp_push_buffer):  Since we no longer set return_at_eof,
      	remove the unused return_at_eof parameter.
      	* cppfiles.c, cpplib.c, cppmacro.c, cpppch.c, fix-header.c:
      	Update callers of cpp_push_buffer.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72016 138bc75d-0d04-0410-961f-82ee72b054a4
      9eb74666
  15. Jul 22, 2003
    • zack's avatar
      * hashtable.c (approx_sqrt): Make static. · 196ce2be
      zack authored
      	* 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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69672 138bc75d-0d04-0410-961f-82ee72b054a4
      196ce2be
  16. Jul 19, 2003
    • ghazi's avatar
      * alias.c alloc-pool.c bitmap.c bitmap.h bt-load.c builtins.c · f0af5a88
      ghazi authored
      	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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69587 138bc75d-0d04-0410-961f-82ee72b054a4
      f0af5a88
  17. Jul 13, 2003
    • zack's avatar
      * Makefile.in (LIBCPP_DEPS): Remove coretypes.h and $(TM_H). · 69edc0b3
      zack authored
      	(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.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69298 138bc75d-0d04-0410-961f-82ee72b054a4
      69edc0b3
  18. Jun 25, 2003
  19. Jun 17, 2003
  20. Jun 01, 2003
  21. Apr 24, 2003
  22. Apr 23, 2003
    • neil's avatar
      * Makefile.in (c-lex.o, LIBCPP_OBJS, cpplex.o): Update. · 4970d4c2
      neil authored
      	* c-lex.c (MULTIBYTE_CHARS): Remove conditionals.
      	(lex_string): Take cpp_string with full spelling.
      	(cb_ident): Update.
      	(c_lex): Update diagnostics.
      	* cpplex.c (SPELL_NUMBER, SPELL_STRING): Combine into SPELL_LITERAL.
      	(create_literal): New.
      	(lex_string): Unterminated literals have type CPP_OTHER.
      	(_cpp_lex_direct): Update calls to lex_string.  Use create_literal
      	for CPP_OTHER.
      	(cpp_token_len, cpp_spell_token, cpp_output_token): Simplify.
      	(_cpp_equiv_tokens, cpp_interpret_charconst): Update.
      	* cpplib.c (parse_include, do_line, do_linemarker,
      	destringize_and_run): Update for token storing full spelling.
      	* cpplib.h: Update token spelling types.
      	* cppmacro.c (stringify_arg, check_trad_stringification):
      	Update for token storing full spelling.
      cp:
      	* Make-lang.in (lex.o): Remove mbchar.h.
      	* lex.c (MULTIBYTE_CHARS): Lose.
      	* parser.c (cp_lexer_get_preprocessor_token): CPP_OTHER handled
      	in c-lex.c.
      testsuite:
      	* gcc.dg/cpp/include2.c: Update.
      	* gcc.dg/cpp/multiline-2.c: New.
      	* gcc.dg/cpp/multiline.c: Update.
      	* gcc.dg/cpp/strify2.c: Update.
      	* gcc.dg/cpp/trad/literals-2.c: Update.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66019 138bc75d-0d04-0410-961f-82ee72b054a4
      4970d4c2
  23. Apr 22, 2003
    • neil's avatar
      * c-lex.c (c_lex): Handle CPP_OTHER differently. · bc205914
      neil authored
      	* cppexp.c (_cpp_parse_expr): Similarly.
      	* cpplex.c (SPELL_CHAR): Remove.
      	(_cpp_lex_direct): Stray chars are saved as byte strings.
      	(cpp_spell_token, cpp_output_token, _cpp_equiv_token): Don't
      	handle SPELL_CHAR.
      	(cpp_avoid_paste): Update handling of CPP_OTHER.
      	* cpplib.h: Spell CPP_OTHER like a number.
      	(struct cpp_token): Remove member c.
      	* cppmacro.c (stringify_arg): Update handling of CPP_OTHER.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65951 138bc75d-0d04-0410-961f-82ee72b054a4
      bc205914
  24. Apr 19, 2003
    • neil's avatar
      * cppfiles.c (ENABLE_VALGRIND_CHECKING, VALGRIND_DISCARD, · a54e0bf8
      neil authored
      	MMAP_THRESHOLD, TEST_THRESHOLD, SHOULD_MMAP): Remove.
      	(struct include_file): Remove fefcnt, mapped members.
      	(open_file, stack_include_file, _cpp_pop_file_buffer): Disable caching.
      	(read_include_file): Don't use mmap, terminate buffers in '\r'.
      	(purge_cache): Don't use munmap.
      	* cpphash.h (CPP_BUF_COLUMN): Update.
      	(lexer_state): Remove lexing_comment.
      	(struct _cpp_line_note): New.
      	(struct cpp_buffer): New members cur_note, notes_used, notes_cap,
      	next_line and need_line.  Remove col_adjust and saved_flags.
      	(_cpp_process_line_notes, _cpp_clean_line, _cpp_get_fresh_line,
      	_cpp_skip_block_comment, scan_out_logical_line): New.
      	(_cpp_init_mbchar): Remove.
      	* cppinit.c (init_library): Remove call to _cpp_init_mbchar.
      	(cpp_read_main_file): Set line to 1 earlier.
      	(post_options): -traditional-cpp doesn't want trigraphs.
      	* cpplex.c (MULTIBYTE_CHARS): Remove code predicated on this.
      	(add_line_note, _cpp_clean_line, _cpp_process_line_notes,
      	_cpp_get_fresh_line): New.
      	(handle_newline, skip_escaped_newlines, trigraph_p,
      	continue_after_nul, _cpp_init_mbchar): Remove.
      	(get_effective_char): Update.
      	(_cpp_skip_block_comment): Rename from skip_block_comment, simplify.
      	(skip_line_comment): Simplify.
      	(skip_whitespace, parse_identifier, parse_slow, parse_number,
      	parse_string): Update.
      	(cpp_lex_direct): Use clean lines and process line notes.  Update.
      	(cpp_interpret_charconst): No MULTIBYTE_CHARS.
      	* cpplib.c (prepare_directive_trad): Call scan_out_logical_line
      	directly.
      	(_cpp_handle_directive): Don't set saved_flags.
      	(run_directive, destringize_and_run, cpp_define, cpp_define_builtin,
      	cpp_undef, handle_assertion, cpp_push_buffer): Update.
      	(_cpp_pop_buffer): Free notes.
      	* cppmacro.c (builtin_macro, paste_tokens): \n terminate buffer.
      	* cpppch.c (cpp_read_state): \n terminate buffer.
      	* cpptrad.c (skip_escaped_newlines, handle_newline): Remove.
      	(copy_comment): Use _cpp_skip_block_comment.
      	(skip_whitespace, lex_identifier, _cpp_read_logical_line_trad):
      	Simplify.
      	(_cpp_overlay_buffer, _cpp_remove_overlay, push_replacement_text,
      	save_replacement_text): Update.
      	(scan_out_logical_line): Update to use clean lines and process
      	line notes.
      	* fix-header.c (read_scan_file): Update.
      testsuite:
      	* gcc.dg/cpp/_Pragma4.c: Remove stray space.
      	* gcc.dg/cpp/trad/escaped-eof.c: Correct line number.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65808 138bc75d-0d04-0410-961f-82ee72b054a4
      a54e0bf8
  25. Mar 14, 2003
  26. Feb 21, 2003
  27. Dec 16, 2002
  28. Oct 09, 2002
  29. Sep 28, 2002
  30. Sep 22, 2002
    • kazu's avatar
      * ChangeLog: Follow spelling conventions. · d10cfa8d
      kazu authored
      	* ChangeLog.0: Likewise.
      	* ChangeLog.1: Likewise.
      	* ChangeLog.2: Likewise.
      	* ChangeLog.3: Likewise.
      	* ChangeLog.4: Likewise.
      	* ChangeLog.5: Likewise.
      	* ChangeLog.6: Likewise.
      	* FSFChangeLog.10: Likewise.
      	* FSFChangeLog.11: Likewise.
      	* alias.c: Likewise.
      	* basic-block.h: Likewise.
      	* c-aux-info.c: Likewise.
      	* c-common.c: Likewise.
      	* c-common.h: Likewise.
      	* c-decl.c: Likewise.
      	* c-format.c: Likewise.
      	* c-semantics.c: Likewise.
      	* c-typeck.c: Likewise.
      	* calls.c: Likewise.
      	* cfganal.c: Likewise.
      	* cfgloop.c: Likewise.
      	* collect2.c: Likewise.
      	* combine.c: Likewise.
      	* conflict.c: Likewise.
      	* cppexp.c: Likewise.
      	* cppfiles.c: Likewise.
      	* cpphash.h: Likewise.
      	* cppinit.c: Likewise.
      	* cpplex.c: Likewise.
      	* cpplib.c: Likewise.
      	* cpplib.h: Likewise.
      	* cppmacro.c: Likewise.
      	* cse.c: Likewise.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57398 138bc75d-0d04-0410-961f-82ee72b054a4
      d10cfa8d
  31. Sep 20, 2002
  32. Aug 07, 2002
  33. Aug 06, 2002
    • neil's avatar
      * cppinit.c (struct lang_flags): Rename trigraphs std. · ed909a09
      neil authored
      	(set_lang): Update.
      	* cpplib.h (struct cpp_options): New member std.
      	* cppmacro.c (_cpp_builtin_macro_text): Use std.
      	(collect_args): Flag whether to swallow a possible future
      	comma pasted with varargs.
      	(replace_args): Use this flag.
      	* doc/cpp.texi: Update varargs extension documentation.
      testsuite:
      	* gcc.dg/cpp/vararg3.c, gcc.dg/cpp/vararg4.c: New tests.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56077 138bc75d-0d04-0410-961f-82ee72b054a4
      ed909a09
  34. Aug 02, 2002
    • zack's avatar
      * c-common.c (c_common_init): -Wtraditional also implies -Wlong-long. · 3385506f
      zack authored
      	* cppinit.c (cpp_post_options): Likewise.
      
      	* cppexp.c (cpp_classify_number): Suppress -Wtraditional
      	warning about 'LL' suffix (but not 'ULL' etc) when
      	-Wno-long-long is in effect.
      
      	* cppmacro.c (_cpp_builtin_macro_text) [BT_TIME, BT_DATE]:
      	Check for failing time()/localtime(), issue a warning, and
      	make __TIME__ and __DATE__ expand to fallback strings.
      
      	* doc/cpp.texi, doc/extend.texi: Document behavior of __DATE__
      	and __TIME__ when the date and time cannot be determined.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55969 138bc75d-0d04-0410-961f-82ee72b054a4
      3385506f
  35. Jul 26, 2002
  36. Jul 23, 2002
    • neil's avatar
      * cppexp.c (parse_defined): Mark macro used. · 71a7c282
      neil authored
      	* cpphash.h (struct cpp_macro): New member "used".
      	(_cpp_mark_macro_used, _cpp_warn_if_unused_macro): New.
      	(struct cpp_reader): New member.
      	* cppinit.c (cpp_finish_options): Set first_unused_line.
      	(cpp_finish): Warn of unused macros if requested.
      	(OPT_TABLE): New switches.
      	(cpp_handle_option): Handle them.
      	* cpplib.c (do_undef): Warn if macro unused.
      	(do_ifdef, do_ifndef): Mark macro used.
      	* cpplib.h (struct cpp_options): New member.
      	* cppmacro.c (_cpp_warn_if_unused_macro): New.
      	(enter_macro_context): Mark macro used.
      	(_cpp_create_definition): Mark macro unused; warn if unused
      	when redefined.
      	* cpptrad.c (scan_out_logcial_line, push_replacement_text):
      	Mark macros used.
      	* doc/cppopts.texi: Update.
      testsuite:
      	* gcc.dg/cpp/trad/Wunused.c, gcc.dg/cpp/trad/Wunused.h,
      	gcc.dg/cpp/Wunused.c, gcc.dg/cpp/Wunused.h: New tests.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55692 138bc75d-0d04-0410-961f-82ee72b054a4
      71a7c282
  37. Jul 17, 2002
  38. Jul 01, 2002
  39. Jun 19, 2002
    • neil's avatar
      * cpphash.h (struct cpp_reader): Make date and time strings. · 9c343313
      neil authored
      	(_cpp_builtin_macro_text, _cpp_copy_replacement_text,
      	_cpp_replacement_text_len): New.
      	* cppinit.c (cpp_create_reader): Update.
      	(init_builtins): Register appropriate builtins for -traditional-cpp.
      	* cppmacro.c (new_number_token): Remove.
      	(_cpp_builtin_macro_text): New.
      	(builtin_macro): Use it.
      	(cpp_macro_definition): Update to handle traditional macros.
      	* cppmain.c (cb_line_change): Don't do column positioning for
      	traditional output.
      	* cpptrad.c (enum ls): Rename ls_fun_macro to ls_fun_open.  New
      	state ls_fun_close.
      	(skip_whitespace): Fix.
      	(maybe_start_funlike): Don't set state.parsing_args.
      	(scan_out_logical_line): Remove duplicate error.  Use lex_state
      	rather than state.parsing_args.
      	(push_replacement_text): Handle builtins.
      	(_cpp_replacement_text_len, _cpp_copy_replacement_text): New.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54771 138bc75d-0d04-0410-961f-82ee72b054a4
      9c343313
  40. Jun 13, 2002
    • neil's avatar
      * cpplib.c (end_directive): Handle line skipping. Only remove · 01628c3c
      neil authored
      	the rest of the line if the directive was valid.
      	* cppmacro.c (_cpp_push_text_context): Set NODE_DISABLED when
      	expanding a traditional macro.
      	* cpptrad.c (recursive_macro): New.
      	(read_logical_line_trad): Handle skipping.
      	(scan_out_logical_line): Continue after a successful directive.
      	Don't expand macros whilst skipping, or if recursing.
      	(_cpp_create_trad_definition): scan_out_logical_line now sets
      	the output current position.
      
      
      git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54573 138bc75d-0d04-0410-961f-82ee72b054a4
      01628c3c
Loading