aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.c
AgeCommit message (Collapse)AuthorFilesLines
2000-03-31cpplib.h: Merge struct cpp_options into struct cpp_reader.Zack Weinberg1-15/+15
* cpplib.h: Merge struct cpp_options into struct cpp_reader. Reorder struct cpp_options and struct cpp_reader for better packing. Replace CPP_OPTIONS macro with CPP_OPTION which takes two args. Change all 'char' flags to 'unsigned char'. Move show_column flag into struct cpp_options. Don't prototype cpp_options_init. * cpphash.h, cpperror.c, cppexp.c, cppfiles.c, cpphash.c, cppinit.c, cpplex.c, cpplib.c: Replace CPP_OPTIONS (pfile)->whatever with CPP_OPTION (pfile, whatever), and likewise for opts = CPP_OPTIONS (pfile); ... opts->whatever; * cppinit.c (merge_include_chains): Take a cpp_reader *. Extract CPP_OPTION (pfile, pending) and work with that directly. (cpp_options_init): Delete. (cpp_reader_init): Turn on on-by-default options here. Allocate the pending structure here. (cl_options, enum opt_code): Define these from the same table, kept in a large macro. Add -fshow-column and -fno-show-column options. * cpperror.c (v_message): If show_column is off, don't print the column number. * cppmain.c: Update for new interface. * fix-header.c: Likewise. From-SVN: r32850
2000-03-28cppfiles.c (hash_IHASH): Just return i->hash.Zack Weinberg1-19/+35
2000-03-28 Zack Weinberg <zack@wolery.cumb.org> * cppfiles.c (hash_IHASH): Just return i->hash. (cpp_included): Set dummy.hash using _cpp_calc_hash. Use htab_find_with_hash. (cpp_read_file): Likewise. (find_include_file): Likewise. Properly initialize ih->nshort. Share ih->name and ih->nshort if possible. * cpphash.c (_cpp_calc_hash): New function. (hash_HASHNODE): Just return h->hash. (_cpp_lookup): Set dummy.hash using _cpp_calc_hash. Use htab_find_with_hash. * cpphash.h: Prototype _cpp_calc_hash. * cppinit.c (initialize_builtins): Provide a valid hash to _cpp_make_hashnode, using _cpp_calc_hash. * cpphash.c (collect_expansion): # is not a special character in object-like macros. In -traditional mode, /**/ is not token paste at the beginning or end of the line. * cpplib.c (do_include, do_import, do_include_next): If parse_include fails, return immediately. From-SVN: r32792
2000-03-15* cpphash.c (dump_hash_helper): Take the slot, not the element.Jason Merrill1-3/+3
From-SVN: r32566
2000-03-15cpphash.c (collect_formal_parameters): Do not complain about parameter names ↵Alexandre Oliva1-1/+2
that just start with `__VA_ARGS__'. * cpphash.c (collect_formal_parameters): Do not complain about parameter names that just start with `__VA_ARGS__'. From-SVN: r32563
2000-03-14cpphash.c (dump_hash_helper): Only dump nodes of type T_MACRO.Zack Weinberg1-1/+5
* cpphash.c (dump_hash_helper): Only dump nodes of type T_MACRO. Emit a newline after each definition. From-SVN: r32518
2000-03-13Makefile.in (LIBCPP_OBJS): Add cpplex.o.Zack Weinberg1-6/+43
* Makefile.in (LIBCPP_OBJS): Add cpplex.o. (cpplex.o): New target. * po/POTFILES.in: Add cpplex.c. * cpplex.c (_cpp_grow_token_buffer, null_cleanup, cpp_push_buffer, cpp_pop_buffer, cpp_scan_buffer, cpp_expand_to_buffer, cpp_buf_line_and_col, cpp_file_buffer, skip_block_comment, skip_line_comment, skip_comment, copy_comment, _cpp_skip_hspace, _cpp_skip_rest_of_line, _cpp_parse_name, skip_string, parse_string, _cpp_parse_assertion, cpp_get_token, cpp_get_non_space_token, _cpp_get_directive_token, find_position, _cpp_read_and_prescan, _cpp_init_input_buffer): Move here. (maybe_macroexpand, _cpp_lex_token): New functions. * cpplib.c (SKIP_WHITE_SPACE, eval_if_expr, parse_set_mark, parse_goto_mark): Delete. (_cpp_handle_eof): New function. (_cpp_handle_directive): Rename from handle_directive. (_cpp_output_line_command): Rename from output_line_command. (do_if, do_elif): Call _cpp_parse_expr directly. * cppfiles.c (_cpp_read_include_file): Don't call init_input_buffer here. * cpphash.c (quote_string): Move here, rename _cpp_quote_string. * cppexp.c (_cpp_parse_expr): Diddle parsing_if_directive here; pop the token_buffer and skip the rest of the line here. * cppinit.c (cpp_start_read): Call _cpp_init_input_buffer here. * cpphash.h (CPP_RESERVE, CPP_IS_MACRO_BUFFER, ACTIVE_MARK_P): Define here. (CPP_SET_BUF_MARK, CPP_GOTO_BUF_MARK, CPP_SET_MARK, CPP_GOTO_MARK): New macros. (_cpp_quote_string, _cpp_parse_name, _cpp_skip_rest_of_line, _cpp_skip_hspace, _cpp_parse_assertion, _cpp_lex_token, _cpp_read_and_prescan, _cpp_init_input_buffer, _cpp_grow_token_buffer, _cpp_get_directive_token, _cpp_handle_directive, _cpp_handle_eof, _cpp_output_line_command): Prototype them here. * cpplib.h (enum cpp_token): Add CPP_MACRO. (CPP_RESERVE, get_directive_token, cpp_grow_buffer, quote_string, output_line_command): Remove. From-SVN: r32513
2000-03-13cpphash.c: Don't include version.h.Zack Weinberg1-3/+2
* cpphash.c: Don't include version.h. (special_symbol) [case T_VERSION]: Look for the string in hp->value.cpval; don't use version_string. * cppinit.c (initialize_builtins): Set hp->value.cpval for __VERSION__ to version_string. * Makefile.in (cpphash.o): Update deps. From-SVN: r32499
2000-03-12Convert cpplib to use libiberty/hashtab.c.Zack Weinberg1-105/+135
* cpplib.h (struct cpp_reader): Make hashtab and all_include_files of type 'struct htab *'. Delete HASHSIZE and ALL_INCLUDE_HASHSIZE macros. * cpphash.h: Update prototypes. (struct hashnode): Remove next, prev, and bucket_hdr members. Make length a size_t. Add hash member. (struct ihash): Remove next member. Add hash member. Make name a flexible array member. * cppfiles.c: Include hashtab.h. (include_hash): Delete. (IHASHSIZE): New macro. (hash_IHASH, eq_IHASH, _cpp_init_include_hash): New functions. (cpp_included): Do the hash lookup here. (_cpp_find_include_file): Rewrite. (cpp_read_file): Put the "fake" hash entry into the hash table. Honor the control_macro, if it turns out we've seen the file before. Don't push the buffer here. (_cpp_read_include_file): Push the buffer here. (OMODES): New macro. Use it whenever we call open(2). * cpphash.c: Include hashtab.h. (hash_HASHNODE, eq_HASHNODE, del_HASHNODE, dump_hash_helper, _cpp_init_macro_hash, _cpp_dump_macro_hash, _cpp_make_hashnode, _cpp_lookup_slot): New functions. (HASHSIZE): new macro. (hashf, _cpp_install, _cpp_delete_macro): Delete. (_cpp_lookup): Use hashtab.h routines. * cppinit.c: Include hashtab.h. (cpp_reader_init): Call _cpp_init_macro_hash and _cpp_init_include_hash. Don't allocate hashtab directly. (cpp_cleanup): Just call htab_delete on pfile->hashtab and pfile->all_include_files. (initialize_builtins): Use _cpp_make_hashnode and htab_find_slot to add hash entries. (cpp_finish): Just call _cpp_dump_macro_hash. * cpplib.c: Include hashtab.h. (do_define): Use _cpp_lookup_slot and _cpp_make_hashnode to create hash entries. (do_pragma_poison, do_assert): Likewise. (do_include): Don't push the buffer here. Don't increment system_include_depth unless _cpp_read_include_file succeeds. (do_undef, do_unassert): Use _cpp_lookup_slot and htab_clear_slot or htab_remove_elt. (do_pragma_implementation): Use alloca to create copy. * Makefile.in: Update dependencies. From-SVN: r32497
2000-03-11cppfiles.c (file_cleanup, [...]): Replace bcopy(), index() etc calls.Neil Booth1-8/+9
* cppfiles.c (file_cleanup, _cpp_find_include_file, remap_filename, _cpp_read_include_file, actual_directory, hack_vms_include_specification): Replace bcopy(), index() etc calls. Add casts to some allocations. Make some variables pointers to const [unsigned] char. * cpphash.c (_cpp_install, macro_cleanup, collect_expansion, collect_formal_parameters): Similarly. * cppinit.c (struct pending_option, append_include_chain, cpp_options_init, cpp_reader_init, initialize_standard_includes, cpp_start_read, new_pending_define, handle_option): Similarly. * cpplib.c (cpp_define, copy_comment, do_define, do_include, do_undef, do_error, do_warning, do_pragma, do_pragma_once, do_pragma_implementation, detect_if_not_defined, do_ifdef, skip_if_group, cpp_get_token, parse_string, do_assert, do_unassert): Similarly. * cpplib.h (cpp_buffer, cpp_options): Update types. Update function prototypes. * mkdeps.c (deps_add_target, deps_add_dep): cast allocations. From-SVN: r32477
2000-03-09cpphash.c (collect_formal_parameters): strncmp returns 0 for match.Zack Weinberg1-2/+2
* cpphash.c (collect_formal_parameters): strncmp returns 0 for match. (cpp_compare_defs): Count the nul separator when advancing over argument names. From-SVN: r32448
2000-03-08cpplib.h (parse_underflow_t, [...]): Delete.Zack Weinberg1-44/+40
* cpplib.h (parse_underflow_t, CPP_NULL_BUFFER): Delete. (struct cpp_buffer): Remove fname and underflow fields. (struct cpp_reader): Remove get_token field. (struct include_hash): Rename to struct ihash. Add typedef to IHASH. (struct if_stack): Remove fname field. (IF_STACK_FRAME): Rename to IF_STACK. * cpperror.c (print_containing_files): Trust that there are no macro buffers below the top file buffer. * cppfiles.c: Replace all references to 'struct include_hash' with 'IHASH'. Rename initialize_input_buffer to init_input_buffer. Don't set or reference cpp_buffer->fname, use buffer->ihash->name instead. * cpphash.c (special_symbol): Use cpp_file_buffer. Use NULL not CPP_NULL_BUFFER. * cppinit.c: Use NULL not CPP_NULL_BUFFER, IF_STACK not IF_STACK_FRAME, IHASH not struct include_hash. * cpplib.c: Rename eval_if_expression to eval_if_expr. Remove null_underflow. Use IF_STACK not IF_STACK_FRAME, IHASH not struct include_hash, NULL not CPP_NULL_BUFFER. Remove all references to cpp_buffer->fname (delete entirely, or use ->ihash->name instead) and IF_STACK->fname. (cpp_push_buffer): Don't set new->underflow. (do_include): Use cpp_file_buffer. * cpphash.c (collect_formal_parameters): Remove duplicate increment of argslen. Pedwarn in C99 mode if __VA_ARGS__ is used as a macro argument name. Don't append "..." to namebuf for varargs macros. After we're done scanning, go through namebuf and make it NUL separated, not comma separated. (_cpp_compare_defs): Remove register tag from variables. Expect defn->argnames to be NUL separated. (_cpp_dump_definition): Expect defn->argnames to be NUL separated and in forward order. * cpphash.h: Update documentation of argnames field. From-SVN: r32430
2000-03-08* cpphash.c (special_symbol): Fix thinko in previous commit.Zack Weinberg1-1/+1
From-SVN: r32399
2000-03-07cppfiles.c (_cpp_find_include_file): Make sure ih->name is initialized.Zack Weinberg1-9/+9
* cppfiles.c (_cpp_find_include_file): Make sure ih->name is initialized. * cppinit.c (cpp_cleanup): Free imp->nshort also. * cpperror.c (cpp_print_containing_files, cpp_print_file_and_line, v_cpp_message): Rename to print_containing_files, print_file_and_line, and v_message. * cppexp.c (cpp_parse_expr, cpp_parse_escape, cpp_lex): Rename to _cpp_parse_expr, parse_escape, and lex. (parse_charconst): Remove broken multibyte support. * cppfiles.c (include_hash): Make static. (cpp_included): New function. (merge_include_chains, find_include_file, finclude, simplify_pathname): Rename to _cpp_merge_include_chains, _cpp_find_include_file, _cpp_read_include_file, and _cpp_simplify_pathname. * cpphash.c (cpp_lookup, free_definition, delete_macro, cpp_install, create_definition, macroexpand, compare_defs, dump_definition): Rename to _cpp_lookup, _cpp_free_definition, _cpp_delete_macro, _cpp_install, _cpp_create_definition, _cpp_macroexpand, _cpp_compare_defs, and _cpp_dump_definition. * cppinit.c (cpp_handle_option): Rename to handle_option, make static. * cpplib.c: Remove extern prototype of cpp_parse_expr. * cpphash.h: Update prototypes. * cpplib.h: Likewise. Prototype _cpp_parse_expr here. From-SVN: r32390
2000-03-07cpphash.c (collect_expansion): Also catch ## at start of macro.Jason Merrill1-0/+2
* cpphash.c (collect_expansion): Also catch ## at start of macro. * varasm.c (make_decl_rtl): Don't add a number to members of local classes. (make_function_rtl): Likewise. From-SVN: r32378
2000-03-06builtins.c (built_in_class_names, [...]): Constify a char*.Kaveh R. Ghazi1-1/+1
* builtins.c (built_in_class_names, built_in_names): Constify a char*. * gmon-sol2.c (monstartup, moncontrol): Cast ptrs to long, not int. (_mcleanup): Ensure value matches format specifier in sprintf. * cpphash.c (special_symbol): Don't needlessly cast away const-ness. * cppinit.c (base_name): Delete unused prototype. * mkdeps.c (deps_init): Make definition K&R safe. * tree.h (built_in_class_names, built_in_names): Constify a char*. f: * ansify.c (die_unless): Don't use ANSI string concatenation. (die): Mark with ATTRIBUTE_NORETURN. From-SVN: r32364
2000-03-04cpplib.h (_dollar_ok): New macro.Zack Weinberg1-5/+11
* cpplib.h (_dollar_ok): New macro. (is_idchar, is_idstart): Use it. (IStable): Rename to _cpp_IStable. Declare it const if gcc >=2.7 or C99. Delete all references to FAKE_CONST. (is_idchar, is_idstart, is_numchar, is_numstart, is_hspace, is_space): Update for renamed IStable. * cppinit.c: Delete all references to FAKE_CONST and CAT macros. Define init_IStable as empty macro if gcc >=2.7 or C99. Change TABLE() to ISTABLE and hardcode name of table. (cpp_start_read): Don't change the IStable based on dollars_in_ident. * cpphash.c (unsafe_chars): Add pfile argument. All callers changed. Handle '$' for char1 correctly. * cpplib.c (cpp_get_token): Use is_numchar when parsing numbers. * cppexp.c (tokentab2): Make const. (cpp_lex): Make toktab const. * cppinit.c (include_defaults_array): Make const. (initialize_standard_includes): Make default_include const. From-SVN: r32321
2000-03-02cppfiles.c (cpp_read_file): New function.Zack Weinberg1-16/+35
* cppfiles.c (cpp_read_file): New function. * cpphash.c (collect_expansion): Make sure to reset last_token to NORM when we hit a string. Handle trailing whitespace properly when the expansion is empty. (create_definition): Disable line commands while parsing the directive line. (dump_definition): If pfile->lineno == 0, output a line command ahead of the dump, and add a trailing newline. * cppinit.c (append_include_chain): Add fifth argument, which indicates whether or not system headers are C++ aware. (initialize_standard_includes): New function, broken out of read_and_prescan. Pass 'cxx_aware' value from the include_defaults_array on to append_include_chain. (dump_special_to_buffer): Const-ify char array. (builtin_array): Don't dump __BASE_FILE__. (cpp_start_read): Use cpp_read_file. Reorder code for clarity. Don't output line commands here for -D/-A/-U switches. Don't call deps_output for files included with -include or -imacros. * cpplib.c (do_define): Don't pay any attention to the second argument. (cpp_expand_to_buffer): Disable line commands while scanning. (output_line_command): Work in the file buffer. * cpplib.h: Remove no_record_file flag from struct cpp_reader. Fix formatting of comments. Prototype cpp_read_file. From-SVN: r32293
2000-03-01cpphash.c (collect_expansion): Trim trailing white space from macro ↵Zack Weinberg1-0/+6
definitions... * cpphash.c (collect_expansion): Trim trailing white space from macro definitions, but don't go past the last insertion point. * gcc.dg/cpp-redef.c: New test. From-SVN: r32283
2000-03-01cpplib.h (CPP_ASSERTION, [...]): New token types.Zack Weinberg1-453/+429
* cpplib.h (CPP_ASSERTION, CPP_STRINGIZE, CPP_TOKPASTE): New token types. (struct cpp_reader): Add parsing_if_directive and parsing_define_directive flags. (struct cpp_options): Remove output_conditionals flag. (check_macro_name): Delete prototype. * cpphash.h (struct macrodef): Delete. (struct reflist): Separate from struct definition. (struct definition): Remove unused fields. Add column number. (create_definition): Returns a DEFINITION *. Takes a cpp_reader * and an int. * cpphash.c (SKIP_WHITE_SPACE): Delete. (PEEKC): Copy defn from cpplib.c. (rest_extension, REST_EXTENSION_LENGTH): Delete. (struct arg): New. (struct arglist): Simplify. (collect_expansion): Rewrite. Get tokens by calling cpp_get_token. Add more error checking. (collect_formal_parameters): New function, broken out of create_definition and reworked to use get_directive_token. (create_definition): All real work is now in collect_expansion and collect_formal_parameters. do_define handles finding the macro name. Return a DEFINITION, not a MACRODEF. (macroexpand): Replace bcopy with memcpy throughout. Replace character-at-a-time copy loop with memcpy and pointer increments. (compare-defs): d1->argnames / d2->argnames might be null. * cpplib.c (copy_rest_of_line): Delete function. (skip_rest_of_line): Do all the work ourselves. (skip_string): New function. (parse_string): Use skip_string. (get_macro_name): New function. (check_macro_name): Delete. (copy_comment): Use CPP_RESERVE and CPP_PUTC_Q. (cpp_skip_hspace): Use CPP_BUMP_LINE. (handle_directive): ICE if we're called on a macro buffer. (do_define): Determine macro name and type (funlike/objlike) here. Expunge all uses of MACRODEF. (cpp_push_buffer): Set line_base to NULL. (do_undef, read_line_number): Don't worry about getting a POP token. (eval_if_expression): Set/reset parsing_if_directive around cpp_parse_expr. Don't clear only_seen_white. (skip_if_group): Remove output_conditionals logic. Use skip_rest_of_line. (cpp_get_token): Return ASSERTION, STRINGIZE, and TOKPASTE tokens under appropriate conditions. (cpp_unassert): Call do_unassert not do_assert. Oops. * cppexp.c (parse_defined): New function, break out of cpp_lex. (cpp_lex): We now get CPP_ASSERTION tokens and can check them ourselves, with cpp_defined. * cppinit.c (cpp_handle_option, print_help): Delete -ifoutput. * gcc.dg/20000209-2.c: Turn off -pedantic-errors. * gcc.dg/strpaste-2.c: New. From-SVN: r32274
2000-02-25Fix copyrights.Jeff Law1-2/+2
From-SVN: r32173
2000-02-15Makefile.in (TREE_H, [...]): Depend on version.h.Kaveh R. Ghazi1-2/+1
* Makefile.in (TREE_H, collect2.o, gcc.h, mips-tfile.o, cccp.o, cpphash.o, cppinit.o, protoize.o, unprotoize.o): Depend on version.h. * cccp.c: Include version.h and/or don't declare `version_string'. * collect2.c: Likewise. * alpha.c: Likewise. * arm/aof.h: Likewise. * arm/coff.h: Likewise. * arm/elf.h: Likewise. * arm/pe.h: Likewise. * arm/tcoff.h: Likewise. * arm/telf.h: Likewise. * arm/tpe.h: Likewise. * arm/vxarm.h: Likewise. * convex/convex.c: Likewise. * i386/dgux.c: Likewise. * i386/sun386.h: Likewise. * m88k/m88k.c: Likewise. * mcore/mcore-pe.h: Likewise. * mips/mips.h: Likewise. * romp/romp.h: Likewise. * sh/sh.c: Likewise. * cpphash.c: Likewise. * cppinit.c: Likewise. * dwarf2out.c: Likewise. * dwarfout.c: Likewise. * gcc.c: Likewise. * gcc.h: Likewise. * mips-tfile.c: Likewise. * protoize.c: Likewise. * toplev.c: Likewise. * tree.h: Likewise. * version.c (version_string): Constify a char*. * version.h: New file. ch: * grant.c: Don't declare `version_string'. f: * g77spec.c: Don't declare `version_string'. java: * Makefile.in (jv-scan, jcf-dump, gcjh): Depend on and link with version.o. (jcf-dump.o, gjavah.o, jv-scan.o): Depend on version.h. * gjavah.c: Include version.h. * jcf-dump.c: Likewise. * jv-scan.c: Likewise. From-SVN: r31984
2000-02-11cpphash.c: Fix formatting, update commentary.Zack Weinberg1-9/+7
* cpphash.c: Fix formatting, update commentary. (dump_definition): Take three separate arguments instead of a MACRODEF structure argument. * cpphash.h: Update prototype of dump_definition. * cppinit.c (cpp_finish): Update call of dump_definition. * cpplib.c (do_define): Always create new hash entry with T_MACRO type. Remove redundant check for redefinition of poisoned identifier. Update call of dump_definition. (do_undef): Don't call check_macro_name. Rename sym_length to len. (do_error, do_warning): Don't use copy_rest_of_line or SKIP_WHITE_SPACE. (do_warning): Don't use pedwarn for the actual warning, only the notice about its not being in the standard. (Fixes bug with #warning in system headers.) (do_ident): Stricter argument checking - accept only a single string after #ident. Also, macro-expand the line. (do_xifdef): Use cpp_defined. De-obfuscate. (do_pragma): Split out specific pragma handling to separate functions. Use get_directive_token. Update commentary. Do not pass on #pragma once or #pragma poison to the front end. (do_pragma_once, do_pragma_implementation, do_pragma_poison, do_pragma_default): New. From-SVN: r31931
2000-02-11cpphash.c (special_symbol): Remove spurious argument to cpp_lookup.Nathan Sidwell1-1/+1
* cpphash.c (special_symbol): Remove spurious argument to cpp_lookup. From-SVN: r31917
2000-02-10cppexp.c: Don't include cpphash.h.Zack Weinberg1-21/+20
* cppexp.c: Don't include cpphash.h. (parse_charconst, cpp_lex): Use cpp_defined. (cpp_lex): Use get_directive_token throughout. Remove unnecessary cases from switch. Move assertion-handling code down to OTHER case. (cpp_parse_expr): If we see '+' or '-', check the context to determine if they are unary or binary operators. Streamline the jumps a bit. Do not call skip_rest_of_line. * cpplib.c: Make skip_rest_of_line and cpp_skip_hspace static. Export get_directive_token. Update commentary. (cpp_defined): New function. (do_define): Remove reference to T_PCSTRING. Call free_definition to release memory for old definition, when redefining a macro. (eval_if_expression): Set only_seen_white to 0 before calling cpp_parse_expr. Call skip_rest_of_line after it returns. (cpp_read_check_assertion): Don't preserve a pointer into the token buffer across a call to cpp_get_token. * Makefile.in (cppexp.o): Don't depend on cpphash.h. * cppfiles.c (redundant_include_p): Use cpp_defined. * cpphash.c (free_definition): New function. (delete_macro): Use it. Update commentary. * cpphash.h: Typedef HASHNODE here. Prototype cpp_lookup and free_definition. * cpplib.h: Don't typedef HASHNODE here. Delete T_PCSTRING from enum node_type. Prototype cpp_defined and get_directive_token. Don't prototype cpp_lookup, skip_rest_of_line, or cpp_skip_hspace. * fix-header.c (check_macro_names): Use cpp_defined. (read_scan_file): Set inhibit_warnings and inhibit_errors in the options structure. From-SVN: r31908
2000-02-10cpplib.h: Provide HASHNODE typedef and forward decl of struct hashnode only.Zack Weinberg1-36/+29
* cpplib.h: Provide HASHNODE typedef and forward decl of struct hashnode only. Kill cpp_hashnode typedef. MACRODEF, DEFINITION, struct hashnode, struct macrodef, struct definition, scan_decls prototype, default defn of INCLUDE_LEN_FUDGE moved elsewhere. * cpphash.h: MACRODEF, DEFINITION, struct macrodef, struct definition, and struct hashnode moved here. Remove the unused 'predefined' field from struct definition. Replace the 'args' union with its sole member. All users updated (cpphash.c). Delete HASHSTEP and MAKE_POS macros, and hashf prototype. Add multiple include guard. * cpphash.c (hashf): Make static; use better algorithm; drop HASHSIZE parameter; return an unsigned int. (cpp_lookup): Drop HASH parameter. PFILE parameter is used. Calculate HASHSIZE modulus here. (cpp_install): Drop HASH parameter. Calculate HASHSIZE modulus here. (create_definition): Drop PREDEFINITION parameter. * cpplib.c (do_define): Don't calculate a hash value here. Don't pass (keyword == NULL) to create_definition. * scan.h: Prototype scan_decls here. * cppfiles.c: Move INCLUDE_LEN_FUDGE default defn here. * cppexp.c, cppfiles.c, cppinit.c, cpplib.c, fix-header.c: All callers of cpp_lookup and cpp_install updated. From-SVN: r31881
2000-02-10cpphash.c (macarg): Hoist all the flag diddling out of the function...Zack Weinberg1-24/+26
* cpphash.c (macarg): Hoist all the flag diddling out of the function... (macroexpand): ... and out of the loop that calls macarg. Skip over the initial paren before macro arguments with cpp_get_non_space_token; point may be some distance before that paren. Abort if it's not there. * cpplib.c (parse_clear_mark): Delete function. (parse_set_mark, parse_goto_mark): Make static. (ACTIVE_MARK_P): New macro. (skip_block_comment, skip_line_comment): Do not bump the line if ACTIVE_MARK_P is true. (cpp_pop_buffer): The buffer to be popped may not have an active mark. (cpp_get_token): When looking for the initial paren before macro arguments, only set a mark in a file buffer, Always return to that mark before proceeding to call macroexpand or return a NAME token. * cpplib.h: Remove prototypes of parse_set_mark, parse_clear_mark, parse_goto_mark. (struct cpp_options): Rename 'put_out_comments' to 'discard_comments' and invert its sense. * cppinit.c, cpphash.c, cpplib.c: All users of put_out_comments changed to use discard_comments, with opposite sense. From-SVN: r31879
2000-02-06cpplib.c (my_strerror, [...]): Move to cpperror.c.Zack Weinberg1-3/+3
* cpplib.c (my_strerror, cpp_error, cpp_error_with_line, cpp_error_from_errno, cpp_warning, cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line, cpp_pedwarn_with_file_and_line): Move to cpperror.c. (cpp_print_file_and_line, v_cpp_error, v_cpp_warning, v_cpp_error_with_line, v_cpp_warning_with_line, cpp_message_from_errno, cpp_perror_with_name): Delete. * cpperror.c (cpp_print_containing_files): Take starting buffer as argument. (cpp_file_line_for_message): Rename to cpp_print_file_and_line. (v_cpp_message): Now called directly by all entry points. Remove -1 case. (cpp_pfatal_with_name, cpp_message): Delete. (cpp_notice_from_errno, cpp_ice): New functions. (cpp_notice): Is now for reporting error conditions, just without an associated file. (cpp_error, cpp_error_with_line): Don't do anything if opts->inhibit_errors is on. (cpp_pedwarn_with_file_and_line): Take column argument also. * cpplib.h: Update prototypes of exported functions. (struct cpp_options): Add inhibit_errors. * cppalloc.c, cppfiles.c: Use fprintf not cpp_notice for non-error messages. Include intl.h. * cppinit.c, cppmain.c: Likewise. Also, use cpp_notice_from_errno instead of cpp_perror_with_name or cpp_pfatal_with_name, and cpp_notice instead of cpp_message. * cppexp.c, cpphash.c, cppinit.c, cpplib.c: Use cpp_ice to report internal errors. * cpplib.c (do_define): Switch bcopy to memcpy. Give cpp_pedwarn_with_file_and_line a dummy column argument. From-SVN: r31829
2000-02-06cppfiles.c (read_and_prescan): Bump input pointer before possibly branching ↵Zack Weinberg1-8/+7
off to the backslash code. * cppfiles.c (read_and_prescan) [case SPECCASE_QUESTION]: Bump input pointer before possibly branching off to the backslash code. * cpphash.c (macroexpand): Correctly delete \r escapes when stringifying parameters. * cpplib.c (copy_rest_of_line): Go directly to skip_block_comment if we can; bail out early if we hit a line comment. (handle_directive): Treat '# 123' in an .S file just like '# <punctuation>'. Discard the shifted '#' if we hit '#\n'. Return 1 for '# not_a_directive'. (get_directive_token): Pop macro buffers here, so that cpp_get_token can't sneakily move past a newline. Add sanity checks. (cpp_get_token): goto randomchar if handle_directive returns 0. From-SVN: r31819
2000-02-06cpperror.c: Remove #ifdef EMACS block.Zack Weinberg1-16/+2
* cpperror.c: Remove #ifdef EMACS block. * cppmain.c: Likewise. * cpphash.c: Remove #if 0 blocks. * cppinit.c: Remove #if 0 blocks, and the -lint option. * cpplib.c: Remove #if 0 blocks and code referencing pcp_inside_if or for_lint. Remove duplicate error message. Fix error messages for #else after #else or #elif. Reformat. Remove archaic TODO list. * cpplib.h: Remove pcp_inside_if and for_lint flags. From-SVN: r31817
2000-02-02cpplib.h (cpp_reader): Add new flag, no_directives.Zack Weinberg1-0/+2
* cpplib.h (cpp_reader): Add new flag, no_directives. * cpphash.c (macarg): Set it. * cpplib.c (handle_directive): If no_directives is on and we find a directive, issue an error and discard the line. From-SVN: r31763
2000-01-22cpphash.c (change_newlines): Delete function.Zack Weinberg1-73/+4
* cpphash.c (change_newlines): Delete function. (struct argdata): Delete 'newlines' and 'use_count' fields. (macroexpand): Remove code referencing those fields. From-SVN: r31559
2000-01-11fix typosJason Merrill1-1/+1
From-SVN: r31336
2000-01-04builtins.c (expand_builtin_strlen): Initialize variable `icode'.Kaveh R. Ghazi1-3/+3
* builtins.c (expand_builtin_strlen): Initialize variable `icode'. * calls.c (expand_call): Likewise for `old_stack_arg_under_construction'. * cpphash.c (macroexpand): Likewise for `args' and `rest_zero'. * function.c (pad_to_arg_alignment): Likewise for `save_var' and `save_constant'. * gcc.c (execute): Likewise for `ut' and `st'. * genattrtab.c (attr_rtx): Likewise for `rt_val'. * genopinit.c (gen_insn): Likewise for `m1', `m2' and `op'. * jump.c (jump_optimize_1): Likewise for `temp2'. * local-alloc.c (block_alloc): Likewise for `r1'. * loop.c (recombine_givs): Likewise for `life_start' and `life_end'. * reg-stack.c (check_asm_stack_operands): Likewise for `clobber_reg'. (subst_asm_stack_regs): Likewise for `clobber_reg' and `clobber_loc'. * regmove.c (fixup_match_1): Likewise for `insn_const', `dst_node' and `set2'. * reload.c (find_reloads): Likewise for `goal_alternative_number' and `goal_earlyclobber'. * scan-decls.c (scan_decls): Likewise for `prev_id_end'. * sdbout.c (sdbout_one_type): Likewise for `member_scl'. * stupid.c (stupid_life_analysis): Likewise for `chain'. * unroll.c (copy_loop_body): Likewise for `copy'. * varasm.c (output_constructor): Likewise for `byte'. ch: * actions.c (update_else_range_for_int_const): Initialize variables `lowval' and `highval'. (update_else_range_for_range): Likewise for `low_range_val' and `high_range_val'. cp: * class.c (warn_hidden): Initialize variable `fndecl'. From-SVN: r31207
1999-10-29cpplib.h (struct cpp_buffer: fname, [...]): Mark const.Zack Weinberg1-29/+29
1999-10-28 21:27 -0700 Zack Weinberg <zack@bitmover.com> * cpplib.h (struct cpp_buffer: fname, nominal_fname, last_nominal_fname): Mark const. (struct include_hash: name, nshort, control_macro): Mark const. (struct macrodef: symnam): Mark const. (struct if_stack: fname): Mark const. (is_idchar, is_idstart, is_hor_space, trigraph_table): Delete. (IStable): New character-syntax array which encompasses all the old is_foo arrays. (is_idchar, is_numchar, is_idstart, is_numstart, is_hspace, is_space): New macros for interrogating IStable. (check_macro_name): Kill last argument. All callers changed. * cppinit.c (initialize_char_syntax): Delete. (is_idchar, is_idstart, is_hor_space, is_space, trigraph_table): Delete. (IStable): New. Initialize with clever macros to avoid information duplication. (builtin_array): Table of builtins to get rid of explicit list in initialize_builtins. (initialize_builtins): Use builtins_array. (cpp_start_read): Call init_IStable, and set IStable['$'] if opts->dollars_in_ident. * cppexp.c: Change all refs to is_xyz[] arrays to use new is_xyz() macros. (cpp_parse_expr): Avoid 'format string is not constant' warning. Use ISGRAPH to identify printable chars. * cppfiles.c: Change all refs to is_xyz[] arrays to use new is_xyz() macros. (read_and_prescan): Map trigraphs to chars with open-coded if-else-if-... sequence, not a lookup table. * cpphash.c: Change all refs to is_xyz[] arrays to use new is_xyz() macros. * cpplib.c: Change all refs to is_xyz[] arrays to use new is_xyz() macros. Kill SKIP_ALL_WHITE_SPACE (unused). (check_macro_name): Remove ability to report an invalid assertion name, which is never used. (do_line): Constify a couple of char *'s. * cppmain.c (main): Call cpp_cleanup before returning. From-SVN: r30252
1999-09-09Makefile.in (cppexp.o): Depend on cpphash.h.Geoff Keating1-0/+7
* Makefile.in (cppexp.o): Depend on cpphash.h. * cppexp.c (cpp_lex): Handle `defined (xxx)' for poisoned xxx. Include cpphash.h. * cpphash.c (special_symbol): Handle plain `xxx' for poisoned xxx. * cpplib.c (do_define): Generalise to handle poisoned definitions, redefining poisoned identifiers, etc. (do_undef): Don't allow poisoned identifiers to be undefined. (do_pragma): Add #pragma poison. (do_xifdef): Handle `#ifdef xxx' for poisoned xxx. * cccp.c: Add T_POISON node type. (special_symbol): Handle `defined(xxx)' and plain `xxx' for poisoned xxx. (do_define): Generalise to handle poisoned definitions, redefining poisoned identifiers, etc. (do_undef): Don't allow poisoned identifiers to be undefined. (do_pragma): Add #pragma poison. (do_xifdef): Handle `#ifdef xxx' for poisoned xxx. * c-pragma.c (handle_pragma_token): Ignore #pragma poison. * c-pragma.h: Add ps_poison state. We now always have generic pragmas. From-SVN: r29224
1999-09-07cpperror.c (cpp_file_line_for_message): Constify a char*.Kaveh R. Ghazi1-4/+13
* cpperror.c (cpp_file_line_for_message): Constify a char*. * cppexp.c (parse_number, parse_charconst, cpp_lex, cpp_parse_expr): Add static prototypes. (parse_charconst): Don't cast away const-ness. (token): Constify a char*. * cppfiles.c (file_name_list, include_hash, find_include_file, finclude, initialize_input_buffer): Constify a char*. (file_cleanup, find_position): Add static prototypes. * cpphash.c (macro_cleanup, macarg, timestamp, special_symbol, collect_expansion): Add static prototypes. (cpp_install, create_definition, monthnames): Constify a char*. * cpphash.h (cpp_install): Likewise. * cppinit.c (known_suffixes, default_include, dump_special_to_buffer, NAME, cpp_start_read, cpp_finish): Likewise. (base_name, dump_special_to_buffer, initialize_dependency_output): Add static prototypes. * cpplib.c (my_strerror): Constify a char*. (null_underflow, null_cleanup, skip_comment, copy_comment, copy_rest_of_line, handle_directive, pass_thru_directive, get_directive_token, read_line_number, cpp_print_file_and_line, v_cpp_error, v_cpp_warning, v_cpp_error_with_line, v_cpp_warning_with_line, detect_if_not_defined, consider_directive_while_skipping): Add static prototypes. (pass_thru_directive, check_macro_name, cpp_expand_to_buffer, cpp_pedwarn_with_file_and_line): Constify a char*. * cpplib.h (cpp_options, include_hash, progname, definition, cpp_pedwarn_with_file_and_line, cpp_expand_to_buffer, check_macro_name, cpp_pfatal_with_name, cpp_file_line_for_message, find_include_file, deps_output, include_hash): Constify a char*. * cppmain.c (progname): Constify. (main): Add prototype. Use return, not exit. * fix-header.c (fatal, add_symbols, lookup_std_proto, write_lbrac, recognized_macro, check_macro_names, read_scan_file, write_rbrac, inf_skip_spaces, inf_read_upto, inf_scan_ident, inf_scan_ident, check_protection): Add static prototype. (xfree): Remove. (progname, recognized_macrom, recognized_extern): Constify a char*. (main): Add prototype. * gen-protos.c (progname): Constify a char*. From-SVN: r29171
1999-09-06Merge in gcc2-ss-010999Jeff Law1-1/+1
From-SVN: r29150
1999-08-04cpphash.c (macroexpand): Delete leading whitespace when arg is concatenated ↵Zack Weinberg1-9/+15
before. Wed Aug 4 13:29:23 1999 Zack Weinberg <zack@bitmover.com> * cpphash.c (macroexpand): Delete leading whitespace when arg is concatenated before. (unsafe_chars): Correct test for whether + and - can extend a token. * cppinit.c (cpp_start_read): Do dependencies for -include/-imacros files also. * cpplib.c (cpp_scan_buffer): In no-output mode, don't bother tokenizing non-directive lines. (cpp_expand_to_buffer): Temporarily disable no-output mode. * cppmain.c: In no-output mode, just call cpp_scan_buffer for the input file. From-SVN: r28512
1999-06-07cpplib.c (do_define): Cast `alloca' return value.Dave Brolley1-3/+4
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-04-26cpphash.c (dump_definition): New function.Zack Weinberg1-0/+97
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-14cpperror.c, [...]: Never call abort.Zack Weinberg1-5/+9
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-12cpphash.c (collect_expansion, [...]): Make the escape character in macro ↵Zack Weinberg1-42/+15
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-09cpphash.c (special_symbol): When expanding __LINE__, use the top file ↵Zack Weinberg1-1/+1
buffer, not the top buffer. 1999-04-09 22:58 -0400 Zack Weinberg <zack@rabi.columbia.edu> * cpphash.c (special_symbol): When expanding __LINE__, use the top file buffer, not the top buffer. From-SVN: r26319
1999-04-06cppexp.c (parse_charconst): Initialize c.Zack Weinberg1-1/+1
1999-04-06 12:56 -0400 Zack Weinberg <zack@rabi.columbia.edu> * cppexp.c (parse_charconst): Initialize c. (cpp_parse_expr): Initialize rprio. * cppfiles.c (merge_include_chains): Initialize prev. (finclude) Set fp->line_base to fp->buf before returning. * cpphash.c (macroexpand): Initialize token. * cppspec.c (lang_specific_driver): Change suff to const char *const *. From-SVN: r26213
1999-03-16cppfiles.c (read_and_prescan): Map backslash-newline to '\r' (which cannot ↵Zack Weinberg1-0/+2
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-02-25cpphash.c (install): Rename to cpp_install, add cpp_reader* first argument.Zack Weinberg1-21/+8
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-18cpplib.c: Kill define of STDC_VALUE.Zack Weinberg1-14/+1490
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-08cpplib.c (special_symbol): Rewrite.Zack Weinberg1-9/+5
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-01-06Copyright fixes.Jeff Law1-1/+1
From-SVN: r24535
1998-12-15cpphash.h (union hash_value): Remove `keydef' member, add a `struct hashnode ↵Zack Weinberg1-5/+2
*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