Commit Graph

117 Commits

Author SHA1 Message Date
Dave Brolley
e7553be55a cpplib.c (do_define): Cast `alloca' return value.
Mon Jun  7 13:33:39 1999  Dave Brolley  <brolley@cygnus.com>
	* cpplib.c (do_define): Cast `alloca' return value.
	(do_include, do_undef, do_pragma): Likewise.
	* cpphash.c (dump_definition): Cast `xstrdup' and `alloca' return
 	values.
	* cppfiles.c (initialize_input_buffer): Cast `xmalloc' return values.
	* gcc/cppspec.c (lang_specific_driver): Cast xmalloc return value.

From-SVN: r27391
1999-06-07 06:35:27 -04:00
Zack Weinberg
3caee4a8ee cpphash.c (dump_definition): New function.
1999-04-26 19:16 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
	* cpphash.c (dump_definition): New function.
	* cpphash.h: Prototype it.
	* cpplib.c (handle_directive): Don't output anything here.
	Streamline.
	(pass_thru_directive): Take a length, not a pointer to the
	end.  All callers changed.
	(do_define): Handle -dD, -dN, -g3 entirely here.  Streamline.
	(do_include): Handle -dI here.
	(do_ident): Correct to match cccp.
	(do_pragma): Copy the pragma through here.
	(do_assert, do_unassert): Tidy.
	* cppinit.c (cpp_finish): If -dM was specified, walk the macro
	hash table and call dump_definition on all the entries.
	* cppmain.c: cpp_finish may produce output.

From-SVN: r26659
1999-04-26 16:41:02 +00:00
Zack Weinberg
80e9dcb4b2 cpplib.c (output_line_command): Drop CONDITIONAL argument.
1999-04-19 14:51 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
	* cpplib.c (output_line_command): Drop CONDITIONAL argument.
	We can omit unnecessary line commands if file_change ==
	same_file and pfile->lineno != 0.  All callers changed.
	(cpp_get_token [case '\n']): Don't bump pfile->lineno if
	CPP_OPTIONS (pfile)->no_line_commands is set.
	* cpplib.h: Fix prototype of output_line_command.

From-SVN: r26547
1999-04-19 11:55:04 +00:00
Zack Weinberg
34ca9541e7 cpperror.c, [...]: Never call abort.
1999-04-14 12:37 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
	* cpperror.c, cppexp.c, cpplib.c: Never call abort.
	* cpphash.c: Only call abort when we detect corruption of the
	malloc arena.
	* cppmain.c: Don't define fatal or fancy_abort.

From-SVN: r26442
1999-04-14 09:40:56 +00:00
Zack Weinberg
ed45de9838 cpphash.c (collect_expansion, [...]): Make the escape character in macro buffers '\r', not '@'.
1999-04-12 14:55 -0400  Zack Weinberg  <zack@rabi.columbia.edu>
	* cpphash.c (collect_expansion, macroexpand,
	push_macro_expansion): Make the escape character in macro
	buffers '\r', not '@'.  Remove code to protect literal
	occurences of the escape character; '\r' cannot appear
	in a macro buffer unless we put it there.
	* cpplib.c (skip_comment, copy_comment, cpp_skip_hspace,
	copy_rest_of_line, cpp_get_token, parse_string,
	parse_assertion): '\r' might be a backslash-newline marker, or
	it might be a macro escape marker, depending on
	CPP_BUFFER (pfile)->has_escapes.  '@' is not a special
	character.
	* cpplib.h: Update commentary.

From-SVN: r26371
1999-04-12 12:03:10 +00:00
Kaveh R. Ghazi
8db99db275 Warning fixes:
* cccp.c (create_definition): Cast to U_CHAR* when assigning to one.
        * cppfiles.c (read_and_prescan): Likewise.
        Start a #define in column 0.
        * cpplib.c (cpp_define): Cast to U_CHAR* when assigning to one.
        (cpp_push_buffer): Likewise for cpp_buffer*.
        (do_include): Change the type of `fbeg' and `fend' to unsigned char*.
        (do_endif): Cast to char* when assigning to one.
        (do_assert): Likewise.
        (do_unassert): Likewise.
        (cpp_read_check_assertion): Change the type of `name' to U_CHAR*.
        Don't do unnecessary cast to char* anymore.
        * genrecog.c (make_insn_sequence): Cast to char** when assigning
        to one.  Cast the first argument of bzero to PTR.
        * loop.c (strength_reduce): Remove unused variable `note'.
        * reload1.c (new_insn_chain): Cast to struct insn_chain* when
        assigning to one.
        * rtl.c (copy_rtx): Use memcpy instead of bcopy.

From-SVN: r25860
1999-03-19 12:43:55 +00:00
Zack Weinberg
3fdc651fed cppfiles.c (read_and_prescan): Map backslash-newline to '\r' (which cannot otherwise appear in the processed...
1999-03-16 16:06 -0500  Zack Weinberg  <zack@rabi.columbia.edu>
	* cppfiles.c (read_and_prescan): Map backslash-newline to '\r'
	(which cannot otherwise appear in the processed buffer) and
	move it out of tokens that it appears in the middle of.
	Improve performance.
	(find_position): New function.
	* cpplib.c: \r (one character) indicates backslash
	newline, not \\\n (two characters).  It cannot appear in the
	middle of a token.  Call CPP_BUMP_LINE (pfile) whenever
	parsing moves past \n or \r.  Increment pfile->lineno whenever
	a \n is placed into token_buffer.  Only one mark can exist at
	a time, and CPP_BUMP_LINE must not be used while it is
	active.  It is automatically cleared by cpp_pop_buffer and
	parse_goto_mark.  \r is not in is_hor_space or is_space.
	(NEWLINE_FIX, NEWLINE_FIX1, adjust_position,
	update_position, count_newlines, parse_move_mark): Removed.
	(parse_string, copy_comment): New functions.
	(parse_name): Returns void.
	(parse_set_mark, parse_clear_mark, parse_goto_mark): Take only
	one argument, a cpp_reader *.  Change for new marking scheme.
	(skip_comment): Handle CHILL line comments too.  Second
	argument is now first character of comment marker; all callers
	changed.  Issue error for unterminated block comment here.
	(cpp_skip_hspace): Recognize CHILL comments.
	(copy_rest_of_line): Likewise.  Call skip_comment and
	parse_string directly, don't go through cpp_get_token.  Emit
	"/**/" for block comments if -traditional (create_definition
	needs this).
	(do_define): Don't play with put_out_comments.
	(cpp_push_buffer): Initialize ->mark to -1.
	(cpp_buf_line_and_col): Just read out the values in the buffer
	structure.
	(output_line_command): Use cpp_buf_line_and_col.  Fix
	formatting.  Remove stale code.
	(cpp_get_token): Break out string parsing code to
	parse_string.  Use skip_comment for CHILL comments too.  Use
	copy_comment for put_out_comments instead of dinking with
	marks.  Remove stale code.  Don't call output_line_command
	unless it's necessary.
	* cpplib.h (parse_marker): Removed.
	(struct cpp_buffer): line_base is now a unsigned char *; add
	`mark' [long], remove `marks' [struct parse_marker *].
	(parse_set_mark, parse_clear_mark, parse_goto_mark): Update
	prototypes.
	(CPP_BUMP_LINE, CPP_BUMP_BUFFER_LINE): New macros.
	* cppinit.c (is_hor_space, is_space): '\r' is not considered
	whitespace.
	* cppexp.c (cpp_parse_expression): Use cpp_skip_hspace, not
	SKIP_WHITE_SPACE.
	* cpphash.c (macarg): Disable line commands while expanding.

From-SVN: r25802
1999-03-16 08:10:15 -05:00
Zack Weinberg
0b22d65c9a cppinit.c: Instead of one pending list...
1999-03-15 21:39 -0500  Zack Weinberg  <zack@rabi.columbia.edu>
	* cppinit.c: Instead of one pending list, keep separate lists
	for each category of pending option: -D/-U, -A, -include,
	-imacros.  Move the four partial include-path lists into the
	pending block.  Use head and tail pointers so we don't ever
	have to reverse the lists.
	(cpp_start_read): Break out blocks of code to their own
	functions: install_predefs and initialize_dependency_output.
	Use path_include for C_INCLUDE_PATH and friends as well as
	CPATH.  Remove include_defaults gunk.  Warn about the
	combination of -lang-chill and -trigraphs.  Optimize string
	bashing.  Walk each pending list once, deallocating as we go.
	(append_include_chain): Brought over from cppfiles.c.  Mark
	dirs as system include dirs if and only if appending to
	system include path. If opts->verbose, print a notice when a
	dir is dropped from the include path because it doesn't
	exist.  Fix memory leak: this function is not supposed to copy
	its DIR argument.
	(nreverse_pending, push_pending): Removed.
	(APPEND): New macro for adding to pending lists.
	(path_include): Can now add to any partial include path.
	(base_name): Bring over from cccp.c.
	(cpp_options_init): Allocate the pending block.
	(cpp_handle_option): Add --version.  Exit after --help.  Fix
	formatting.  Order -ifoo options by frequency of usage.
	(install_predefs): New function, simplified version of code
	that was in cpp_start_read.
	(initialize_dependency_output): Likewise.  Understand OBJECT_SUFFIX.
	* cppfiles.c (simplify_pathname): Export.
	(merge_include_chains):  Don't nreverse the lists.  If
	opts->verbose, print a notice when a duplicate dir is detected
	and dropped from the include path.
	(finclude): Fix excessive cleverness in setting
	fp->system_header_p.
	(actual_directory): Set x->sysp from
	CPP_BUFFER (pfile)->system_header_p so that one system header
	may include another with "".
	(deps_output): Fix double adjustment of deps_size which would
	cause all dependencies after the first two lines to be lost.
	* cpplib.c (cpp_unassert): New function.
	* cpplib.h: Lay out struct cpp_pending here.  Adjust
	prototypes.  Add include_prefix_len to struct cpp_options.

From-SVN: r25793
1999-03-15 18:42:46 +00:00
Kaveh R. Ghazi
e915b770d9 Makefile.in (cppmain.o, [...]): Don't depend on machmode.h.
* Makefile.in (cppmain.o, cpplib.o, cpphash.o, cppalloc.o,
        cpperror.o, cppexp.o, cppfiles.o, cppinit.o, fix-header.o,
        scan-decls.o): Don't depend on machmode.h.
        * cppexp.c: Don't define CHAR_BIT or HOST_BITS_PER_WIDE_INT anymore.
        Replace all instances of HOST_WIDE_INT with HOST_WIDEST_INT.
        * cppfiles.c: Likewise.
        * cpplib.c: Likewise.
        * cpplib.h: Likewise.  Also don't include machmode.h anymore.

From-SVN: r25446
1999-02-25 20:40:21 +00:00
Zack Weinberg
122ae89b14 cpphash.c (install): Rename to cpp_install, add cpp_reader* first argument.
1999-02-25 17:14 -0500  Zack Weinberg  <zack@rabi.columbia.edu>
	* cpphash.c (install): Rename to cpp_install, add cpp_reader*
	first argument.  All callers changed.
	(hashtab): Removed.
	(cpp_lookup, cpp_install): Change all refs to hashtab to
	pfile->hashtab.
	(cpp_hash_cleanup): Removed.
	* cpphash.h: Adjust prototypes.
	* cpplib.h (struct cpp_reader): Add hashtab pointer.
	* cppinit.c (cpp_reader_init): Also allocate space for the
	hashtab.
	(cpp_cleanup): Delete all macros and free the hashtab.

From-SVN: r25441
1999-02-25 14:24:40 +00:00
Zack Weinberg
6de1e2a978 cpplib.c: Kill define of STDC_VALUE.
1999-02-18 18:32 -0500  Zack Weinberg  <zack@rabi.columbia.edu>
	* cpplib.c: Kill define of STDC_VALUE.  Don't include output.h
          or prefix.h. Change CPP_IS_MACRO_BUFFER to not refer to
          macro_cleanup.
	  (GET_ENV_PATH_LIST, PATH_SEPARATOR, STANDARD_INCLUDE_DIR,
          predefs, SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE,
          CPP_WCHAR_TYPE, USER_LABEL_PREFIX, REGISTER_PREFIX, struct
          cpp_pending, version_string, struct default_include,
          include_defaults_array, path_include, cpp_options_init,
          dump_special_to_buffer, initialize_builtins, cpp_start_read,
          cpp_reader_init, nreverse_pending, push_pending, print_help,
          cpp_handle_option, cpp_handle_options, cpp_finish,
          cpp_cleanup): Move to cppinit.c.
	  (macro_cleanup, struct arglist, collect_expansion,
	  create_definition, compare_defs, comp_def_part, ARG_BASE,
	  struct argdata, macarg, change_newlines, timestamp,
	  monthnames, special_symbol, unsafe_chars, macroexpand,
	  push_macro_expansion): Move to cpphash.c.
	  (quote_string, check_macro_name, cpp_expand_to_buffer,
	  output_line_command, cpp_undef): Export.
	  (null_underflow, null_cleanup, handle_directive): Make static.
	* cpplib.h: Prototype now-exported functions.  Adjust decls of
          syntax tables so we can include cpplib.h in cppinit.c.
	* cpphash.h: Prototype all functions exported by cpphash.c.
	* cppinit.c: Make syntax tables initialized data if possible
          (uses GCC designated-initializer extension).
	* cppexp.c:  Make cpp_lex static.
	* Makefile.in: Move -D switches for the various include dirs
          from cpplib.o rule to cppinit.o rule.  Adjust dependencies.

From-SVN: r25287
1999-02-18 15:35:49 +00:00
Zack Weinberg
4d9a1b48f9 c-common.c (UNGETC [USE_CPPLIB=1]): Do nothing if c is EOF.
1999-02-15 16:59 -0500  Zack Weinberg  <zack@midnite.ec.rhno.columbia.edu>
	* c-common.c (UNGETC [USE_CPPLIB=1]): Do nothing if c is EOF.
	* c-lex.c: Likewise.
	* cpplib.c (cpp_push_buffer, cpp_pop_buffer): Use a linked
	list in malloced memory for the buffer stack.
	(cpp_get_token): Don't pop the last buffer off the stack.
	Calls after CPP_EOF has been returned produce CPP_EOF with no
	state change.
	(cpp_finish): Pop last buffer here.
	(do_line): Don't free ip->last_nominal_fname if it is equal to
	ip->fname.
	(special_symbol): If a T_CONST is the empty string, push a
	single `@ ' escape instead.
	(macroexpand): Special symbol buffers have escapes too.
	* cpplib.h (struct cpp_buffer): Remove unused fields, add prev
	buffer pointer.
	(struct cpp_reader): Remove buffer_stack.  Add
	buffer_stack_depth.
	(CPP_PREV_BUFFER, CPP_NULL_BUFFER): Buffer stack is now a
	linked list.

From-SVN: r25218
1999-02-15 14:04:21 +00:00
Brendan Kehoe
e4d8ad2321 cpplib.c (special_symbol): Move IP to be declared in function scope, rather than individual case statements.
* cpplib.c (special_symbol): Move IP to be declared in function
	scope, rather than individual case statements.
fixes building under solaris

From-SVN: r25112
1999-02-09 10:02:18 -05:00
Zack Weinberg
0961816af0 cpplib.c (do_define): Allow redefining __STDC__ with -D.
1999-02-09 10:30 -0500  Zack Weinberg  <zack@rabi.columbia.edu>
	* cpplib.c (do_define): Allow redefining __STDC__ with -D.

From-SVN: r25109
1999-02-09 07:31:59 +00:00
Zack Weinberg
5dfa4da130 cpplib.c (special_symbol): Rewrite.
1999-02-08 23:25 -0500  Zack Weinberg  <zack@midnite.ec.rhno.columbia.edu>
	* cpplib.c (special_symbol): Rewrite.  Don't copy things
	  multiple times.  Handle __STDC__ specially.  T_CONST
	  indicates a constant /string/.  Don't handle T_*_TYPE and
	  T_SPEC_DEFINED.  Use cpp_buf_line_and_col instead of
	  adjust_position.  Determine the file buffer only if needed.
	  (initialize_builtins): Handle __SIZE_TYPE__,
	  __PTRDIFF_TYPE__, __WCHAR_TYPE__, __USER_LABEL_PREFIX__, and
	  __REGISTER_PREFIX__ with T_CONST special hashtab entries.
	  Don't provide __OBJC__; the driver does that.	 Provide
	  __STDC_VERSION__, using T_CONST.  Use T_STDC for
	  __STDC__.  Give install the length of all symbols defined.
	  (eval_if_expression): Drop code to insert and remove the
	  "defined" special symbol.
	* cpplib.h: Remove SELF_DIR_DUMMY (no longer used).  Remove
	  T_*_TYPE and T_SPEC_DEFINED from enum node_type; add T_STDC.
	* cpphash.c (install): Drop the `ivalue' parameter.  Constify
	  the `value' parameter.  All callers changed.
	* cpphash.h (install): Change prototype to match.
	  (union hashval): Remove `ival' member.
	* cppexp.c (cpp_lex): Handle `defined' here.

From-SVN: r25097
1999-02-08 20:27:27 +00:00
Zack Weinberg
5538ada62f cpplib.c (initialize_char_syntax): Move to cppinit.c.
1999-02-04 14:33 -0500  Zack Weinberg  <zack@rabi.phys.columbia.edu>
	* cpplib.c (initialize_char_syntax): Move to cppinit.c.
	(cpp_define): Remove redundant syntax checks.
	(make_assertion): Rename cpp_assert, remove redundant syntax
	checks, export.
	(cpp_options_init): Don't init things to zero twice.
	(cpp_expand_to_buffer): Use memcpy, not a char-by-char loop.
	(do_include): Kill excessively verbose import warning that
	snuck back in in the gcc2 merge.
	(convert_string): Removed.
	(do_line): Rewrite with simple last-name-used cache instead of
	private hashtable.
	(cpp_start_read): Call initialize_char_syntax here, not...
	(cpp_reader_init): ...here.
	(cpp_handle_options): Support the -std switch.
	* cpplib.h (cpp_buffer): Add last_nominal_fname member.
	(cpp_options): Add c9x flag.
	Declare all the is_* tables and trigraph table here, as const.
	Prototype cpp_assert and initialize_char_syntax.
	* cppinit.c: New file.
	* cppfiles.c (read_and_prescan): Optimize.
	* Makefile.in (LIBCPP_OBJS): Add cppinit.o.

From-SVN: r25024
1999-02-04 06:36:54 -05:00
Kaveh R. Ghazi
1c5d09e4af collect2.c (error): Fix typo in declaration.
* collect2.c (error): Fix typo in declaration.
        * cpperror.c (cpp_message): Likewise.
        * cpplib.c (cpp_warning): Likewise.
        * cpplib.h (cpp_notice): Use PVPROTO not VPROTO, also add
        ATTRIBUTE_PRINTF_1.
        * toplev.c (error): Fix typo in declaration.

From-SVN: r24904
1999-01-29 11:41:02 +00:00
Jeffrey A Law
ab87f8c8d1 Merge in gcc2 snapshot 19980929. See gcc/ChangeLog and gcc/FSFChangeLog for
details.

From-SVN: r24879
1999-01-26 18:43:17 -07:00
Zack Weinberg
554fbeef31 cppfiles.c (safe_read): Deleted.
1999-01-26 12:11 -0500  Zack Weinberg  <zack@midnite.ec.rhno.columbia.edu>
	* cppfiles.c (safe_read): Deleted.
	(read_and_prescan): New function, replaces safe_read, converts
	and/or warns about trigraphs, silently converts odd line
	terminators (\r, \n\r, \r\n).  Warns about no newline at EOF.
	(finclude): Use read_and_prescan; turn off nonblocking mode on
	the input descriptor; remove file-size-examination and
	no-newline-at-EOF gunk which is	longer necessary; be more
	careful about checking that we've been handed a legitimate
	file to read (only real files, pipes, and ttys are acceptable).
	* cpplib.h (cpp_options): Rename no_trigraphs flag to
	`trigraphs' and invert its sense.
	(trigraph_table): Declare.
	(cpp_warning_with_line): Prototype.
	* cpplib.c: Remove all references to trigraph_pcp. Define
	trigraph_table; initialize it in initialize_char_syntax.  Open
	files in nonblocking mode.  s/no_trigraphs/trigraphs/
	throughout, and invert sense.  Put cpp_warning_with_line back
	in and export it.

From-SVN: r24870
1999-01-26 04:12:47 -05:00
Zack Weinberg
20dc736194 cpplib.c: Don't include signal.h, sys/times.h, or sys/resource.h.
1999-01-25 14:10 -0500  Zack Weinberg  <zack@rabi.phys.columbia.edu>
	* cpplib.c: Don't include signal.h, sys/times.h, or
	sys/resource.h. Don't declare localtime.
	(macroexpand): Handle special symbols here.
	(push_macro_expansion): Chop off the trailing '@ ' if possible
	here.
	(cpp_get_token): Don't do either of the above two things here.
	Move `string' label just after case '"' so that wide strings
	don't crash the preprocessor.

From-SVN: r24858
1999-01-25 06:23:01 -05:00
Kaveh R. Ghazi
87e11268b6 cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
* cpplib.c (special_symbol): Qualify a char* with the `const' keyword.
        Instead of writing to const char *buf directly, use a non-const
        variable `wbuf' to allocate and write a string, then set buf = wbuf.
        * cppulp.c (user_label_prefix): Qualify a char* with the `const'
        keyword.
        * dyn-string.c (dyn_string_append): Likewise.
        * dyn-string.h (dyn_string_append): Likewise.
        * final.c (end_final, output_operand_lossage, asm_fprintf): Likewise.
        * output.h (end_final, output_operand_lossage, asm_fprintf,
        named_section, decode_reg_name, make_decl_rtl, user_label_prefix):
        Likewise.
        * profile.c (init_branch_prob): Likewise.
        * toplev.c (set_target_switch, vmessage,
        v_message_with_file_and_line, v_message_with_decl,
        v_error_with_file_and_line, v_error_with_decl, v_error_for_asm,
        verror, vfatal, v_warning_with_file_and_line, v_warning_with_decl,
        v_warning_for_asm, vwarning, vpedwarn, v_pedwarn_with_decl,
        v_pedwarn_with_file_and_line, vsorry, v_really_sorry,
        open_dump_file, dump_rtl, clean_dump_file,
        print_version, print_single_switch, print_switch_values,
        dump_base_name, debug_args, lang_independent_options,
        user_label_prefix, documented_lang_options, target_switches,
        target_options, print_time, pfatal_with_name, fatal_io_error,
        fatal_insn, default_print_error_function, print_error_function,
        report_error_function, error_with_file_and_line, error_with_decl,
        error_for_asm, error, fatal, warning_with_file_and_line,
        warning_with_decl, warning_for_asm, warning, pedwarn,
        pedwarn_with_decl, pedwarn_with_file_and_line, sorry,
        really_sorry, botch, output_quoted_string, output_file_directive,
        open_dump_file, rest_of_decl_compilation, display_help, main):
        Likewise.
        * toplev.h (print_time, fatal, fatal_io_error, pfatal_with_name,
        fatal_insn, warning, error, pedwarn, pedwarn_with_file_and_line,
        warning_with_file_and_line, error_with_file_and_line, sorry,
        really_sorry, default_print_error_function, report_error_function,
        rest_of_decl_compilation, pedwarn_with_decl, warning_with_decl,
        error_with_decl, error_for_asm, warning_for_asm, output_quoted_string,
        output_file_directive, botch): Likewise.
        * tree.h (make_decl_rtl): Likewise.
        * varasm.c (strip_reg_name, named_section, decode_reg_name,
        make_decl_rtl): Likewise.

From-SVN: r24743
1999-01-18 08:53:41 +00:00
Jeffrey A Law
62e7b7195c cccp.c (print_help): Fix typos.
* cccp.c (print_help): Fix typos.
        * cpplib.c (print_help): Fix typos.
        * toplev.c (f_optiosn): Fix typos.
        (documented_lang_options): Fix typos.

From-SVN: r24706
1999-01-16 15:45:49 -07:00
Jeff Law
44ba0e9336 Fix copyright dates.
From-SVN: r24530
1999-01-06 12:54:35 -07:00
Kaveh R. Ghazi
460ee1120c Makefile.in (gcc.o, [...]): Depend on prefix.h.
* Makefile.in (gcc.o, prefix.o, cccp.o, cpplib.o): Depend on prefix.h.
        * cccp.c: Include prefix.h, don't prototype prefix.c functions.
        (new_include_prefix): Constify char* parameters.
        * cppfiles.c (read_name_map): Likewise.
        (append_include_chain): Likewise.  Also, use a writable char* copy
        of parameter `dir' which we then modify, rather than using the
        parameter itself to store the new writable string.
        (remap_filename): Constify some variables.  Also, use a writable
        char* to store an allocated string which we will be modifying.
        * cpplib.c: Include prefix.h, don't prototype prefix.c functions.
        (cpp_start_read): Constify variable `str'.
        * cpplib.h (append_include_chain): Constify a char* parameter.
        * gcc.c Include prefix.h, don't prototype prefix.c functions.
        (add_prefix, save_string): Constify char* parameters.
        (fatal, error): Add ATTRIBUTE_PRINTF_1 to prototypes.
        * prefix.c: Include prefix.h.
        (get_key_value, translate_name, save_string, update_path,
        set_std_prefix): Constify various char* parameters and variables.
        (save_string): Use xmalloc, not malloc.
        (translate_name): Use a writable temporary variable to create and
        modify a string before setting it to a const char*.
        * prefix.h: New file to prototype functions exported from prefix.c.

From-SVN: r24498
1999-01-05 19:11:22 +00:00
Zack Weinberg
ed705a8232 cpplib.c (skip_if_group): Split out the logic that handles directive recognition to its own function.
1998-12-21 18:03 -0500  Zack Weinberg  <zack@rabi.phys.columbia.edu>
	* cpplib.c (skip_if_group): Split out the logic that handles
	directive recognition to its own function.  Don't use
	parse markers; use a bare pointer into the buffer.  Use
	copy/skip_rest_of_line instead of doing it by hand.  Remove
	`return on any directive' mode which was never used, and take
	only one argument.
	(consider_directive_while_skipping): New function, subroutine
	of skip_if_group.  Logic streamlined a bit.
	(conditional_skip, do_elif, do_else): Call skip_if_group with
	only one argument.

From-SVN: r24485
1999-01-04 07:38:22 -05:00
Zack Weinberg
16deb3fb8f cpplib.c (do_undef): EOF immediately after '#undef FOO' is not an error.
Wed Dec 23 17:30:18 1998  Zack Weinberg  <zack@rabi.phys.columbia.edu>
	* cpplib.c (do_undef): EOF immediately after '#undef FOO' is not an
	error.

From-SVN: r24484
1999-01-04 07:15:43 -05:00
Zack Weinberg
692b872ea0 cpplib.c (do_include): Treat #include_next in the primary source file as #include plus warning.
1998-12-16  Zack Weinberg  <zack@rabi.phys.columbia.edu>
	* cpplib.c (do_include): Treat #include_next in the
	primary source file as #include plus warning.  Treat
	#include_next in a file included by absolute path as an
	error.  fp == CPP_NULL_BUFFER is a fatal inconsistency.

From-SVN: r24340
1998-12-16 08:23:47 -05:00
Kaveh R. Ghazi
36b8337d5c cccp.c: Don't define MIN/MAX anymore.
* cccp.c: Don't define MIN/MAX anymore.
        * cpplib.c: Likewise.
        * machmode.h: Likewise.
        * system.h: Provide definitions for MIN/MAX.

From-SVN: r24339
1998-12-16 09:34:57 +00:00
Zack Weinberg
c49445e001 cppalloc.c: Add xstrdup here.
1998-12-15  Zack Weinberg  <zack@rabi.phys.columbia.edu>
	* cppalloc.c: Add xstrdup here.
	* cpplib.h: Remove savestring prototype.
	* cpplib.c: Remove savestring function. s/savestring/xstrdup/
	  throughout.
	* cppfiles.c: s/savestring/xstrdup/ throughout.

From-SVN: r24327
1998-12-15 06:23:27 -05:00
Zack Weinberg
941e09b65f cpplib.c: Make all directive handlers read their own arguments.
1998-12-14 00:56 -0500  Zack Weinberg  <zack@rabi.phys.columbia.edu>
	* cpplib.c: Make all directive handlers read their own
          arguments.
	  (struct directive): Remove last two arguments from FUNC
          member prototype. Remove `command_reads_line' member
          entirely.
	  (directive_table): Remove initializations of
          command_reads_line flag.  Pretty-print.
	  (eval_if_expression, do_define, do_line, do_include,
          do_undef, do_error, do_pragma, do_ident, do_if, do_xifdef,
          do_else, do_elif, do_sccs, do_assert, do_unassert,
          do_warning): Take only two args.
	  (cpp_define): Call do_define with two args and the text to
	  define stuffed into a buffer.
	  (make_assertion): Call do_assert with two args.
	  (handle_directive): Call do_line with two args. Call
	  kt->func with two args.  Remove command_reads_line
	  processing.
	  (do_define, do_undef, do_error, do_warning, do_pragma,
	  do_sccs): Read the rest of the line here.
	  (do_ident): Gobble rest of line, as cccp does.
	  (cpp_undef): New function.
	  (cpp_start_read): Call cpp_undef instead of do_undef.

From-SVN: r24326
1998-12-15 06:17:06 -05:00
Zack Weinberg
7061aa5a9e cpphash.h (union hash_value): Remove keydef' member, add a struct hashnode *aschain' member for #assert.
1998-12-15  Zack Weinberg  <zack@rabi.phys.columbia.edu>
	* cpphash.h (union hash_value): Remove `keydef' member, add a
          `struct hashnode *aschain' member for #assert.
	  * cpplib.c (struct tokenlist_list, struct
          assertion_hashnode): Delete structure definitions.
          (assertion_install, assertion_lookup, delete_assertion,
          check_assertion, compare_token_lists, reverse_token_list,
          read_token_list, free_token_list): Delete functions.
          (parse_assertion): New function.
	  (cpp_cleanup): Don't destroy the assertion_hashtable.
          (do_assert): Gut and rewrite.  #assert foo (bar) places
          entries for `#foo' and `#foo(bar)' in the macro hash table,
          type T_ASSERT.  The value union's `aschain' member is used
          to chain all answers for a given predicate together.
          (do_unassert): Also rewritten.  Take an un-asserted
          answer off the chain from its predicate and call
          delete_macro on the hashnode, or walk a predicate chain
          calling delete_macro on all the entries.
          (cpp_read_check_assertion): Simply call parse_assertion to
          get the canonical assertion name, and look that up in the
          hash table.
	* cpplib.h (ASSERTION_HASHNODE,ASSERTION_HASHSIZE,assertion_hashtab):
 	Removed.
	* cpphash.c (install): Use bcopy instead of an explicit loop
          to copy the macro name.
	* cppexp.c (cpp_lex): Convert the result of
          cpp_read_check_assertion to a `struct operation' directly;
          don't go through parse_number.

From-SVN: r24325
1998-12-15 06:09:16 -05:00
Kaveh R. Ghazi
b4eadc3d64 cpplib.c (convert_string): Use 0x00ff', not 0x00ffU'.
Tue Dec  8 11:58:51 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
	* cpplib.c (convert_string): Use `0x00ff', not `0x00ffU'.

From-SVN: r24182
1998-12-08 04:00:26 -05:00
Zack Weinberg
c50bca0894 cpplib.c (initialize_char_syntax): Use ISALPHA and ISALNUM so it'll work on non-ASCII platforms.
1998-12-07  Zack Weinberg  <zack@rabi.phys.columbia.edu>
	* cpplib.c (initialize_char_syntax): Use ISALPHA and ISALNUM
          so it'll work on non-ASCII platforms.  Always consider $ an
          identifier character.  Take no arguments.
	  (cpp_reader_init): Call initialize_char_syntax with no
          arguments.
	  (cpp_start_read): Don't call initialize_char_syntax again.
          Clear is_idchar['$'] and is_idstart['$'] if not
          opts->dollars_in_ident.
	* cpplib.h (struct cpp_reader): Replace void *data element by
          cpp_options *opts.  Rearrange elements to make gdb printout
          less annoying (put buffer stack at end).
	  (CPP_OPTIONS): Get rid of now-unnecessary cast.
	* cppmain.c: s/data/opts/ when initializing cpp_reader
          structure.
	* c-decl.c: Likewise.
	* objc/objc-act.c: Likewise.
	* fix-header.c: Likewise.

From-SVN: r24154
1998-12-07 09:15:29 -05:00
Zack Weinberg
f1a86df6cb cpplib.h (struct cpp_buffer): Replace dir and dlen members with a struct file_name_list pointer.
1998-11-26 01:17 -0500  Zack Weinberg  <zack@rabi.phys.columbia.edu>
	* cpplib.h (struct cpp_buffer): Replace dir and dlen members
	with a struct file_name_list pointer.
	(struct cpp_reader): Add pointer to chain of `actual
	directory' include searchpath entries.
	(struct file_name_list): Add *alloc pointer for the sake of
	the actual-directory chain.
	Move definition of HOST_WIDE_INT here.
	(cpp_parse_escape): Change prototype to match changes in
	cppexp.c.
	* cppfiles.c (actual_directory): New function.
	(finclude): Use it to initialize the buffer's actual_dir
	entry.
	(find_include_file): We don't need to fix up max_include_len
	here.
	* cpplib.c (do_include): Don't allocate a file_name_list on
	the fly for current directory "" includes, use the one that's
	been preallocated in pfile->buffer->actual_dir.  Hoist out
	duplicate code from the search_start selection logic.
	(cpp_reader_init): Initialize pfile->actual_dirs.
	Remove definition of HOST_WIDE_INT.  Change calls
	to cpp_parse_escape to match changes in cppexp.c (note
	hardcoded MASK, which is safe since this is the source
	character set).
	* cppexp.c: Bring over changes to cpp_parse_escape from cccp.c
	to handle wide character constants in #if directives.  The
	function now returns a HOST_WIDE_INT, and takes a third
	argument which is a binary mask for all legal values (0x00ff
	for 8-bit `char', 0xffff for 16-bit `wchar_t', etc.)  Define
	MAX_CHAR_TYPE_MASK and MAX_WCHAR_TYPE_MASK.  Change callers of
	cpp_parse_escape to match.  [Fixes c-torture/execute/widechar-1.c]

From-SVN: r24153
1998-12-07 08:35:20 -05:00
Dave Brolley
93447205e5 [multiple changes]
Mon Dec  7 15:38:25 1998  Dave Brolley  <brolley@cygnus.com>
	* gcc.c (default_compilers): Fix typo in USE_CPPLIB spec for cc1.
Mon Dec  7 15:38:25 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
        * c-aux-info.c (concat): Wrap function definition in !USE_CPPLIB.
        * cppalloc.c: Move function `xcalloc' from cpplib.c to here.
        * cpplib.c: Move function `xcalloc' from here to cppalloc.c.

From-SVN: r24152
1998-12-07 07:42:21 -05:00
Kaveh R. Ghazi
2778b98d90 system.h: Include libiberty.h.
* system.h: Include libiberty.h.
        * c-aux-info.c: Remove prototypes for concat/concat3.  Change
        function `concat' from fixed parameters to variable parameters,
        as is done in libiberty.  All callers of concat/concat3
        changed to use the new `concat' with variable args.
        * cccp.c: Remove things made redundant by libiberty.h and/or
        conform to libiberty standards.
        * cexp.y: Likewise.
        * collect2.c: Likewise.
        * config/1750a/1750a.h: Likewise.
        * cppalloc.c: Likewise.
        * cppexp.c: Likewise.
        * cppfiles.c: Likewise.
        * cpphash.c: Likewise.
        * cpplib.c: Likewise.
        * dyn-string.c: Likewise.
        * fix-header.c: Likewise.
        * gcc.c: Likewise.
        * gcov.c: Likewise.
        * genattr.c: Likewise.
        * genattrtab.c: Likewise.
        * gencheck.c: Likewise.
        * gencodes.c: Likewise.
        * genconfig.c: Likewise.
        * genemit.c: Likewise.
        * genextract.c: Likewise.
        * genflags.c: Likewise.
        * gengenrtl.c: Likewise.
        * genopinit.c: Likewise.
        * genoutput.c: Likewise.
        * genpeep.c: Likewise.
        * genrecog.c: Likewise.
        * getpwd.c: Likewise.
        * halfpic.c: Likewise.
        * hash.c: Likewise.
        * mips-tdump.c: Likewise.  Wrap malloc/realloc/calloc prototypes
        in NEED_DECLARATION_* macros.
        * mips-tfile.c: Remove things made redundant by libiberty.h and/or
        conform to libiberty standards.
        (fatal): Fix const-ification of variable `format' in
        !ANSI_PROTOTYPES case.
        * prefix.c: Remove things made redundant by libiberty.h and/or
        conform to libiberty standards.
        * print-rtl.c: Rename variable `spaces' to `xspaces' to avoid
        conflicting with function `spaces' from libiberty.
        * profile.c: Remove things made redundant by libiberty.h and/or
        conform to libiberty standards.
        * protoize.c: Likewise.
        * rtl.h: Likewise.
        * scan.h: Likewise.
        * tlink.c: Likewise.
        * toplev.c: Likewise.
        * toplev.h: Likewise.
        * tree.h: Likewise.

From-SVN: r23931
1998-11-27 10:09:17 +00:00
Zack Weinberg
0b3d776a42 cpplib.h: Delete struct import_file.
Wed Nov 25 14:54:46 1998  Zack Weinberg  <zack@rabi.phys.columbia.edu>
        * cpplib.h: Delete struct import_file.  Add ihash element to
        struct cpp_buffer.  Delete dont_repeat_files and
        import_hash_table elements from cpp_reader; change
        all_include_files to a hash table.  Delete all foobar_include
        / last_foobar_include elements from struct cpp_options; put
        back four such: quote_include, bracket_include,
        system_include, after_include.  Redo struct file_name_list
        completely.  Add new structure type include_hash.  Add
        prototypes for merge_include_chains and include_hash.  Change
        prototypes for finclude, find_include_file, and
        append_include_chain to match changes below.
        * cppfiles.c (simplify_pathname, include_hash,
        remap_filename, merge_include_chains): New functions.
        (add_import, lookup_import, open_include_file): Removed.
        (INO_T_EQ): Define this (copied from cccp.c).
        (hack_vms_include_specification): Remove all calls and #if 0
        out the definition.  It was being called incorrectly and at
        the wrong times.  Until a VMSie can look at this, it's better
        to not pretend to support it.
        (append_include_chain): Change calling convention; now takes
        only one directory at a time, and sets up the data structure
        itself.
        (redundant_include_p): Rewritten - this is now used for all
        include redundancy, whether by #ifndef, #import, or #pragma
        once.  Looks up things in the include hash table.
        (file_cleanup): Decrement pfile->system_include_depth here if
        it's >0.
        (find_include_file): Calling convention changed; now passes
        around a struct include_hash instead of 3 separate parameters.
        Guts ripped out and replaced with new include_hash mechanism.
        (finclude): Calling convention changed as for
        find_include_file.  Error exits pulled out-of-line.  Reformat.
        (safe_read): Return a long, not an int.
        (deps_output): Don't recurse.
        * cpplib.c (is_system_include): Deleted.
        (path_include): Fix up call to append_include_chain.
        (do_include): Fix up calls to find_include_file and finclude.
        Clean up dependency output a bit.  Shorten obnoxiously lengthy
        #import warning message.  Don't decrement
        pfile->system_include_depth here.
        (do_pragma): Understand the include_hash structure.  Reformat.
        (do_endif): Correct handling of control macros.  Understand
        the include_hash.
        (cpp_start_read): Fix up calls to finclude.  Call
        merge_include_chains.
        (cpp_handle_option): Fix up calls to append_include_chain.
        Understand the four partial include chains.
        (cpp_finish): Add debugging code (#if 0-ed out) for the
        include_hash.
        (cpp_cleanup): Free the include_hash, not the import hash and
        the all_include and dont_repeat lists which no longer exist.

From-SVN: r23857
1998-11-25 06:56:54 -05:00
Melissa O'Neill
9855b854a4 cccp.c (S_ISREG, S_ISDIR): Delete defines.
* cccp.c (S_ISREG, S_ISDIR): Delete defines.
        * cpplib.c, gcc.c: Likewise.
        * system.h (S_ISREG, S_ISDIR): Define if not already defined.

From-SVN: r23785
1998-11-23 02:20:35 -07:00
Kaveh R. Ghazi
5148a72b33 gansidecl.h: Prepend a "G" to the macro wrapping this file (to distinguish it from the macro...
* gansidecl.h: Prepend a "G" to the macro wrapping this file
        (to distinguish it from the macro wrapping ansidecl.h.)
        Include libiberty's ansidecl.h.  Remove all redundant definitions.
        Define the PROTO() style macros in terms of the PARAMS() ones.
        * calls.c (emit_library_call): Switch on ANSI_PROTOTYPES, not
        __STDC__, when deciding whether to use ANSI variable args.
        (emit_library_call_value): Likewise.
        * cccp.c (error): Likewise.
        (warning): Likewise.
        (error_with_line): Likewise.
        (warning_with_line): Likewise.
        (pedwarn): Likewise.
        (pedwarn_with_line): Likewise.
        (pedwarn_with_file_and_line): Likewise.
        (fatal): Likewise.
        * cexp.y (error): Likewise.
        (pedwarn): Likewise.
        (warning): Likewise.
        * collect2.c (fatal_perror): Likewise.
        (fatal): Likewise.
        (error): Likewise.
        * combine.c (gen_rtx_combine): Likewise.
        * cpperror.c (cpp_message): Likewise.
        (cpp_fatal): Likewise.
        * cpplib.c (cpp_error): Likewise.
        (cpp_warning): Likewise.
        (cpp_pedwarn): Likewise.
        (cpp_error_with_line): Likewise.
        (cpp_warning_with_line): Likewise.
        (cpp_pedwarn_with_line): Likewise.
        (cpp_pedwarn_with_file_and_line): Likewise.
        * cpplib.h: Don't define PARAMS() macro.
        * demangle.h: Likewise.
        * doprint.c (checkit): Switch on ANSI_PROTOTYPES, not __STDC__,
        when deciding whether to use ANSI variable args.
        * emit-rtl.c (gen_rtx): Likewise.
        (gen_rtvec): Likewise.
        * final.c (asm_fprintf): Likewise.
        * fix-header.c (cpp_message): Likewise.
        (fatal): Likewise.
        (cpp_fatal): Likewise.
        * gcc.c (concat): Likewise.
        (fatal): Likewise.
        (error): Likewise.
        * genattr.c (fatal): Likewise.
        * genattrtab.c (attr_rtx): Likewise.
        (attr_printf): Likewise.
        (fatal): Likewise.
        * gencodes.c (fatal): Likewise.
        * genconfig.c (fatal): Likewise.
        * genemit.c (fatal): Likewise.
        * genextract.c (fatal): Likewise.
        * genflags.c (fatal): Likewise.
        * genopinit.c (fatal): Likewise.
        * genoutput.c (fatal): Likewise.
        (error): Likewise.
        * genpeep.c (fatal): Likewise.
        * genrecog.c (fatal): Likewise.
        * halfpic.h: Switch on ANSI_PROTOTYPES, not __STDC__, when
        deciding whether to declare `tree_node' and `rtx_def'.
        * hash.h: Don't define stuff we get from gansidecl.h.
        * mips-tfile.c: Likewise.  Define __proto() in terms of PARAMS().
        (fatal): Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
        whether to use ANSI variable args.
        (error): Likewise.
        * prefix.c (concat): Likewise.
        * scan.h: Likewise.
        * system.h: Likewise.
        * toplev.c (error_with_file_and_line): Likewise.
        (error_with_decl): Likewise.
        (error_for_asm): Likewise.
        (error): Likewise.
        (fatal): Likewise.
        (warning_with_file_and_line): Likewise.
        (warning_with_decl): Likewise.
        (warning_for_asm): Likewise.
        (warning): Likewise.
        (pedwarn): Likewise.
        (pedwarn_with_decl): Likewise.
        (pedwarn_with_file_and_line): Likewise.
        (sorry): Likewise.
        (really_sorry): Likewise.
        * toplev.h: Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
        whether to declare `tree_node' and `rtx_def'.
        * tree.c (build): Switch on ANSI_PROTOTYPES, not __STDC__, when
        deciding whether to use ANSI variable args.
        (build_nt): Likewise.
        (build_parse_node): Likewise.

From-SVN: r23577
1998-11-08 15:10:24 +00:00
Kaveh R. Ghazi
0056a9b5cf configure.in (host_xm_file, [...]): Arrange to include gansidecl.h in {ht}config.h & tm.h just before the config/...
* configure.in (host_xm_file, build_xm_file, xm_file, tm_file):
        Arrange to include gansidecl.h in {ht}config.h & tm.h just
        before the config/ directory headers.
        (tm_file_list, host_xm_file_list, build_xm_file_list): Handle
        gansidecl.h in the list of dependencies.
        * Makefile.in (RTL_BASE_H): Don't depend on gansidecl.h.
        (TREE_H, DEMANGLE_H, RECOG_H, REGS_H, libgcc2.a, stmp-multilib,
        mbchar.o, collect2.o, pexecute.o, vfprintf.o, splay-tree.o, gcc.o,
        gencheck.o, choose-temp.o, mkstemp.o, mkstemp.o, prefix.o,
        dyn-string.o, cexp.o, cccp.o, cppmain.o, cpplib.o, cpperror.o,
        cppexp.o, cppfiles.o, cpphash.o, cppalloc.o, scan-decls.o):
        Likewise.
        * cccp.c: Don't include gansidecl.h.
        * cexp.y: Likewise.
        * collect2.c: Likewise.
        * config/c4x/c4x.c: Likewise.
        * config/v850/v850.h: Likewise.
        * cppalloc.c: Likewise.
        * cpperror.c: Likewise.
        * cppexp.c: Likewise.
        * cppfiles.c: Likewise.
        * cpphash.c: Likewise.
        * cpplib.c: Likewise.
        * cppmain.c: Likewise.
        * cppulp.c: Likewise.
        * demangle.h: Likewise.
        * doprint.c: Likewise.
        * dyn-string.c: Likewise.
        * eh-common.h: Likewise.
        * fix-header.c: Likewise.
        * frame.c: Likewise.
        * gcc.c: Likewise.
        * gcov.c: Likewise.
        * gen-protos.c: Likewise.
        * gencheck.c: Likewise.
        * halfpic.h: Likewise.
        * hash.c: Likewise.
        * machmode.h: Likewise.
        * mbchar.c: Likewise.
        * prefix.c: Likewise.
        * protoize.c: Likewise.
        * recog.h: Likewise.
        * rtl.h: Likewise.
        * scan-decls.c: Likewise.
        * tree.h: Likewise.
        * varray.h: Likewise.

From-SVN: r23558
1998-11-07 13:00:46 +00:00
Zack Weinberg
add7091b5b [multiple changes]
1998-10-28 16:10 -0500	Zack Weinberg  <zack@rabi.phys.columbia.edu>
	 * c-lang.c: Declare extern char *yy_cur if USE_CPPLIB.
	   (lang_init): Call check_newline always.
	 * c-lex.c (init_parse) [USE_CPPLIB=1]: After calling
	   cpp_start_read, set yy_cur and yy_lim to read from
	   parse_in.token_buffer, so that we'll see the first #line
	   directive.
	 * cpplib.c (cpp_start_read): finclude the main input file
	   before processing -include/-imacros.	 Process -imacros and
	   -include separately, and handle -include by stacking a
	   buffer for the file in question as if it'd been #included.
	 * toplev.c (documented_lang_options) Recognize -H when
	   USE_CPPLIB is on.
1998-10-28 16:09 -0500	Zack Weinberg  <zack@rabi.phys.columbia.edu>
	 * cpplib.c: Merge do_once into do_pragma.  Break file handling
	   code out of do_include.
	   Move append_include_chain, deps_output,
	   file_cleanup, redundant_include_p, import_hash,
	   lookup_import, add_import, read_filename_string, read_name_map,
	   open_include_file, finclude, safe_read to cppfiles.c.
	   Move prototypes for deps_output, append_include_chain,
	   finclude to cpplib.h.  Move definition of struct
	   file_name_list there also.
	 * cppfiles.c: New file.  Contains all the above functions
	   broken out of cpplib.c; also hack_vms_include_specification
	   from cccp.c and find_include_file, a new function broken out of
	   do_include.
	 * Makefile.in (cppmain): Depend on cppfiles.o.
	   (fix-header): Likewise.
	   (cppfiles.o): New target.
	 * configure.in (--enable-c-cpplib): Add cppfiles.o to
	   extra_c_objs.  Add ../cppfiles.o to extra_cxx_objs.

From-SVN: r23424
1998-10-29 06:54:13 -05:00
Richard Henderson
19283265ad Makefile.in (cc1): Put C_OBJS, and thence @extra_c_objs@ last.
* Makefile.in (cc1): Put C_OBJS, and thence @extra_c_objs@ last.
        (LIBCPP_OBJS): New.  Add cppulp.o.
        (cppmain, fix-header): Depend on and use libcpp.a.
        * configure.in (extra_c_objs, extra_cxx_objs): Use libcpp.a instead
        of the individual object files.
        * objc/Make-lang.in (cc1obj): Put OBJC_OBJS, and thence @extra_c_objs@,
        last.
        * cccp.c (user_label_prefix): New.
        (main): Set it off -f*leading-underscore.
        (special_symbol): Use it.
        * cpplib.c (special_symbol): Likewise.
        (cpp_handle_option): Handle -f*leading-underscore.
        * cppulp.c: New file.
        * output.h (user_label_prefix): Declare it.
        * dwarf2out.c (ASM_NAME_TO_STRING): Prepend user_label_prefix.
        * toplev.c (f_options, main): Handle -f*leading-underscore.
        * defaults.h (ASM_OUTPUT_LABELREF): Use asm_fprintf instead of
        referencing USER_LABEL_PREFIX directly.
        * config/nextstep.h (ASM_OUTPUT_LABELREF): Likewise.
        * m32r/m32r.h (ASM_OUTPUT_LABELREF): Likewise.
        * final.c (asm_fprintf): Use user_label_prefix instead.
        * arm/thumb.c (thumb_print_operand): Likewise.
        * gcc.c (default_compilers): Pass -f*leading-underscore on to
        cpp wherever appropriate.

From-SVN: r23415
1998-10-28 14:31:06 -08:00
Kaveh R. Ghazi
79c9824ecb Warning fixes:
* Makefile.in (flow.o): Depend on recog.h.
        * cpplib.h (directive_table): Add missing initializiers.
        (finclude): Change type of variable `bsize' to size_t.
        * cse.c (rtx_cost): Mark parameter `outer_code' with ATTRIBUTE_UNUSED.
        * dwarfout.h (dwarfout_label): Wrap prototype in macro RTX_CODE.
        * fix-header.c (lookup_std_proto): Cast the result of `strlen' to
        `int' when comparing against one.
        (cpp_file_line_for_message): Mark parameter `pfile' with
        ATTRIBUTE_UNUSED.
        (cpp_fatal): Mark parameter `pfile' with ATTRIBUTE_UNUSED.
        * flow.c: Include recog.h.
        (sbitmap_copy): Cast arguments 1 & 2 of `bcopy' to (PTR).
        * function.c (thread_prologue_and_epilogue_insns): Mark parameter
        `f' with ATTRIBUTE_UNUSED.
        (reposition_prologue_and_epilogue_notes): Likewise.
        * genopinit.c (gen_insn): Cast argument of ctype functions to
        `unsigned char'.
        * haifa-sched.c: Include recog.h.
        (blockage_range): Cast result of UNIT_BLOCKED macro to (int) when
        comparing against one.
        * libgcc2.a (__throw): Revert ATTRIBUTE_UNUSED change for now.
        * mips-tfile.c (parse_end): Cast the argument of ctype function to
        `unsigned char'.
        (parse_ent): Likewise.
        (parse_input): Likewise.
        * optabs.c (init_libfuncs): Likewise.
        * protoize.c (find_rightmost_formals_list): Likewise.
        * recog.h (const_double_operand): Fix typo in prototype.
        * tlink.c (scan_linker_output): Cast the argument of ctype
        function to `unsigned char'.
        * toplev.c (check_lang_option): Cast the result of `strlen' to
        `int' when comparing against one.

From-SVN: r23155
1998-10-17 20:26:29 +00:00
Dave Brolley
c55ade0244 cpplib.c (cpp_get_token): Replace whitespace that occurs between a macro name and the next token with a...
Fri Oct 16 17:26:10 1998  Dave Brolley  <brolley@cygnus.com>
        * cpplib.c (cpp_get_token): Replace whitespace that occurs between
        a macro name and the next token with a single blank if that whitespace
        is in a macro buffer and the next token is not '('.

From-SVN: r23139
1998-10-16 10:28:40 -04:00
Zack Weinberg
faa765969f cppexp.c: When forcing unsigned comparisons, cast both sides of the operation.
* cppexp.c: When forcing unsigned comparisons, cast both sides
        of the operation.
        * cpphash.h: Move static declaration of hashtab[]...
        * cpphash.c: ...here.
        * cpplib.c: Cast difference of two pointers to size_t before
        comparing it to size_t.  Cast signed to unsigned
        before comparing to size_t. (FIXME: struct argdata should use
        unsigned buffer sizes.)
        * cpplib.h (struct cpp_reader): Declare token_buffer_size as
        unsigned int. (CPP_WRITTEN): Cast return value to size_t.
        (CPP_RESERVE): Parenthesize N for evaluation order, cast to
        size_t before comparison.

From-SVN: r22980
1998-10-10 18:05:11 -06:00
Jeff Law
990c642c89 emit-rtl.c (init_emit_once): Call INIT_EXPANDERS.
* emit-rtl.c (init_emit_once): Call INIT_EXPANDERS.
        * cpplib.h: Protect from multiple inclusions.
        * cpplib.c: Fix minor formatting problems.

From-SVN: r22937
1998-10-08 15:09:20 -06:00
Zack Weinberg
4284b774e6 cpplib.c (macroexpand): Correct off-by-one error in handling of escapes.
* cpplib.c (macroexpand): Correct off-by-one error in handling
        of escapes.

From-SVN: r22827
1998-10-04 18:03:35 -06:00
Zack Weinberg
aa90b11170 cpplib.c (macroexpand): If arg->raw_before or arg->raw_after...
* cpplib.c (macroexpand): If arg->raw_before or
        arg->raw_after, remove any no-reexpansion escape at the
        beginning of the pasted token.  Correct handling of whitespace
        markers and no-reexpand markers at the end if arg->raw_after.

From-SVN: r22695
1998-09-30 13:27:28 -06:00
Zack Weinberg
6fa72945c9 toplev.c (documented_lang_options): Recognize -include, -imacros, -iwithprefix, -iwithprefixbefore.
* toplev.c (documented_lang_options): Recognize -include,
        -imacros, -iwithprefix, -iwithprefixbefore.
        * cpplib.c (cpp_start_read): Process -imacros and -include
        switches at the same time and in command-line order, after
        initializing the dependency-output code.  Emit properly nested
        #line directives for them.  Emit a #line for the main file
        before processing these switches, and don't do it again
        afterward.

From-SVN: r22689
1998-09-30 12:15:13 -06:00
Felix Lee
b2a1e45827 c-lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT ().
* c-lex.c (init_lex): Use getenv ("LANG"), not GET_ENVIRONMENT ().
        * cccp.c (main): Likewise.
        * gcc.c (process_command): Similarly for "GCC_EXEC_PREFIX".
        * cccp.c, collect2.c, cpplib.c, gcc.c, config/i386/xm-cygwin32.h:
        Rename GET_ENVIRONMENT to GET_ENV_PATH_LIST, and fix some
        macro-use bugs.

From-SVN: r22511
1998-09-20 18:56:50 -06:00