Neil Booth [Tue, 11 Jul 2000 08:58:28 +0000 (08:58 +0000)]
cppinit.c: (cpp_reader_init): Allow digraphs by default.
* cppinit.c: (cpp_reader_init): Allow digraphs by default.
(handle_option): Set digraphs according to standard.
Merge OPT_lang_c89 handler with OPT_std_c89.
* cpplex.c: (lex_line, can_paste): Honour digraphs in
accordance with the digraphs flag.
* cpplib.h: (struct cpp_options): New option digraphs.
* config/ia64/ia64.c (got_symbolic_operand): New.
(symbolic_operand, move_operand): Revert 0701 change.
* config/ia64/ia64.h (PREDICATE_CODES): Update.
* config/ia64/ia64-protos.h (got_symbolic_operand): Declare.
* config/ia64/ia64.md (movdi): Revert 0701 wrt symbolic_operand;
split the offset into a 14-bit low part instead of a 13-bit low part.
(load_fptr): Mark the mem as unchanging.
(load_symptr): Use got_symbolic_operand.
Jason Merrill [Mon, 10 Jul 2000 07:16:23 +0000 (03:16 -0400)]
init.c (build_new_1): Bail early if the call to new fails.
* init.c (build_new_1): Bail early if the call to new fails.
* decl.c (compute_array_index_type): Check specifically for
an INTEGER_CST, not just TREE_CONSTANT.
* decl.c (duplicate_decls): Don't call duplicate_decls on
the DECL_TEMPLATE_RESULT.
(decls_match): Return 0 if the DECL_TEMPLATE_RESULTs have different
codes.
* error.c (dump_template_bindings): Don't crash if we had an
invalid argument list.
* typeck.c (c_expand_start_case): Do narrowing here.
* semantics.c (finish_switch_cond): Not here.
* parse.y (asm_clobbers): Do string concatenation.
2000-07-10 Gabriel Dos Reis <gdr@codesourcery.com>
* diagnostic.c (wrap_text): New function.
(maybe_wrap_text): Likewise.
(output_add_string): Use it.
(output_format): Likewise.
(count_error): Use verbatim instead of notice.
(report_error_function): Likewise. Don't use plain fprintf.
(finish_diagnostic): New function.
(output_do_verbatim): Tweak. Commonalize functionalities in
output_verbatim and verbatim.
(output_verbatim): Adjust.
(verbatim): Likewise.
(report_diagnostic): Define.
* cpplex.c (IS_HSPACE, S_NEWLINE): Remove.
(IS_DIRECTIVE): Rename KNOWN_DIRECTIVE.
(skip_block_comment, skip_line_comment, parse_string,
lex_line): Use is_vspace rather than IS_NEWLINE.
(skip_whitespace, lex_line): Clean up to use is_nvspace.
(lex_line): Use KNOWN_DIRECTIVE. Any kind of directive
gets a BOL flag.
(lex_next): Unconditionally stop if within a directive.
Treat directives within macro invocations as directives
(after parse_args emits error), not as the argument.
* testsuite/gcc.dg/cpp/directiv.c: New tests.
* testsuite/gcc.dg/cpp/undef1.c: Update.
cpplib.h (struct cpp_name): Now struct cpp_string.
* cpplib.h (struct cpp_name): Now struct cpp_string.
(CPP_INT, CPP_FLOAT, CPP_NUMBER, CPP_COMMENT,
CPP_HEADER_NAME): Change to type S.
(struct cpp_token): Rename 'name' field to 'str'. Add 'node'
field, a cpp_hashnode *. All references to val.name updated
to use val.str or val.node as appropriate.
(struct cpp_reader): Add spec_nodes field.
(cpp_idcmp): Now cpp_ideq; takes a token * and a char *.
* cpphash.h (struct spec_nodes): New.
(enum spell_type): Reorder. Only SPELL_STRING tokens use
val.str. All references to 'spelling > SPELL_NONE' updated to
match.
(CPP_IN_SYSTEM_HEADER): Check pfile->buffer and
pfile->buffer->inc are not NULL before dereferencing them.
* cpplex.c (parse_name): Take a pointer to the current token,
plus current position and limit as args; return the new
position; don't copy the text of a name into the string
buffer, instead call cpp_lookup and store the node pointer.
If extending a token, copy out the text of the old into a
scratch buffer, append the new, look that up and store the new
node pointer. Inline.
(maybe_paste_with_next): If the result of paste is a NAME,
then look up the pasted text and store its node pointer.
(lex_line): Adjust for new parse_name interface.
Check for L"str", L'str' using spec_nodes->n_L.
(spell_token): SPELL_IDENT tokens have their spelling in
val.node->name. Handle SPELL_STRING tokens that don't have
string delimiters.
(_cpp_expand_name_space,
(can_paste): Check for L ## "str" using spec_nodes->n_L.
(cpp_get_token, special_symbol): No need to call cpp_lookup.
(cpp_idcmp): Now cpp_ideq; take a token * and a const char *;
return 1=equal 0=not, not a tristate.
* cpphash.c (var_args_str): Delete.
(find_param): Compare node fields directly.
(is__va_args__): Use CPP_PEDANTIC. Just compare
token->val.node with spec_nodes->n__VA_ARGS__.
(dump_funlike_macro): Don't use var_args_str.
* cpplib.c (_cpp_check_directive): Just walk through
spec_nodes->dirs comparing pointers.
(get_define_node, do_pragma_poison, detect_if_not_defined,
parse_ifdef): The identifier has already been looked up.
(do_ifdef, do_ifndef): parse_ifdef won't return a poisoned
node.
(do_if): Only call detect_if_not_defined at beginning of file.
(_cpp_parse_assertion): Only copy string pointers for
SPELL_STRING tokens.
(pragma_dispatch): Take a node pointer and examine its name
field.
(_cpp_init_stacks): Also initialize the spec_nodes structure.
* cppinit.c (cpp_reader_init): Call _cpp_init_stacks after
_cpp_init_macros.
(cpp_cleanup): Free pfile->spec_nodes. Call _cpp_cleanup_* in
reverse order from the corresponding _cpp_init_* routines.
* cppexp.c (parse_number, parse_charconst, parse_defined,
lex): Check val.node->type instead of calling cpp_defined.
Use spec_nodes entries where appropriate.
* fix-header.c, scan-decls.c: Update for interface changes.
* jcf-write.c (generate_classfile): Properly install the
ConstantValue attribute and the initial value constant pool index
on string constants.
* parse.y (java_complete_lhs): Keep DECL_INITIAL when emitting
class files.
cppexp.c: Update all code for new lexer interface.
* cppexp.c: Update all code for new lexer interface.
(op_t, operator codes, struct token, tokentab2, op_to_str): Remove.
(struct suffix, vsuf_1, vsuf_2, vsuf_3, op_to_prio): New.
* cpplex.c (token_names): Trim leading CPP_ from names; make
the strings unsigned.
(_cpp_spell_operator): New.
(is_macro_disabled): Disable all macros if rescanning
preprocessed text.
(_cpp_get_directive_token): Remove.
* cppinit.c: Don't set no_macro_expand.
* cpplib.c (read_line_number, do_line): Check only for EOF,
not VSPACE.
* cpphash.h: Update prototypes.
* cpplib.h (CPP_VSPACE): Remove.
(struct cpp_reader): Remove no_macro_expand.
Neil Booth [Sat, 8 Jul 2000 02:18:25 +0000 (02:18 +0000)]
cpphash.c (is__va_args__): New function.
* cpphash.c (is__va_args__): New function.
(count_params): Fix line reported in error messages. Use
is__va_args__. Don't return ')' on error. Flag GNU style
rest args macro definitions.
(parse_define): Check macro name is not __VA_ARGS__.
(save_expansion): Check identifier in non-varargs-macro is
not __VA_ARGS__. Don't flag GNU_VARARGS.
* cpplex.c (parse_args): Accept no argument iff GNU_REST_ARGS.
(maybe_paste_with_next): Use per-macro GNU_REST_ARGS rather
than per-token GNU_VARARGS.
* cpplib.h (GNU_VARARGS): Remove.
(GNU_REST_ARGS): New.
Benjamin Kosnik [Sat, 8 Jul 2000 01:25:04 +0000 (01:25 +0000)]
configure.in (AC_OUTPUT_COMMANDS): Link $THREADS.h and c++threads.h instead of copying.
2000-07-07 Benjamin Kosnik <bkoz@soma.redhat.com>
* configure.in (AC_OUTPUT_COMMANDS): Link $THREADS.h and
c++threads.h instead of copying.
* acinclude.m4 (GLIBCPP_ENABLE_THREADS): Do link here.
Tweaks.
Jakub Jelinek [Fri, 7 Jul 2000 19:55:29 +0000 (21:55 +0200)]
sibcall.c (uses_addressof): Add INMEM argument...
* sibcall.c (uses_addressof): Add INMEM argument, check for
current_function_internal_arg_pointer outside of MEM rtxs in addition
to ADDRESSOFs.
(sequence_uses_addressof): Update caller.
* gcc.c-torture/execute/20000706-1.c: New test.
* gcc.c-torture/execute/20000706-2.c: New test.
* gcc.c-torture/execute/20000706-3.c: New test.
* gcc.c-torture/execute/20000706-4.c: New test.
* gcc.c-torture/execute/20000706-5.c: New test.
* parse.h (BUILD_PTR_FROM_NAME): Surround with a do/while
construct.
* parse.y (find_as_inner_class): Fixed typo.
(do_resolve_class): Explore enclosing contexts when searching for
innerclasses. Removed curly brackets around BUILD_PTR_FROM_NAME.
(check_inner_class_access): Check `decl' which can be null in case
of previous errors.
* java-tree.h (java_debug_context): Declared `extern.'
(safe_layout_class): Likewise.
* parse.y (resolve_field_access): Field must be `static' in order
to be replaced by its initial value. Added comments.
(find_applicable_accessible_methods_list): Fixed typo.
(find_most_specific_methods_list): Methods found in innerclasses
take over methods founds in the enclosing contexts.
(java_complete_tree): Loosen restrictions on the type of DECLs
that can be replaced by their initialization values.
(valid_ref_assignconv_cast_p): Removed call to `enclosing_context_p.'
* expr.c (build_instanceof): Layout type after it's loaded. Fixes
gcj/271.
(Fix to the PR gcj/271, gcj/272 and gcj/275:
http://sourceware.cygnus.com/ml/java-prs/2000-q3/msg00000.html
http://sourceware.cygnus.com/ml/java-prs/2000-q3/msg00002.html
http://sourceware.cygnus.com/ml/java-prs/2000-q3/msg00001.html )
* tradcpp.c: New file.
* tradcif.y: New file.
* tradcif.c: New generated file.
* Makefile.in: Add rules to build tradcpp.o, tradcif.o,
$(srcdir)/tradcif.c. Add tradcpp to STAGESTUFF and
dependencies of C. Install tradcpp from install-common, in
$(libsubdir).
* cppinit.c: Include cppdefault.h. Refer to
cpp_GCC_INCLUDE_DIR and cpp_GCC_INCLUDE_DIR_len, not directly
to GCC_INCLUDE_DIR and its length.
(SIZE_TYPE, PTRDIFF_TYPE, WCHAR_TYPE,
USER_LABEL_PREFIX, REGISTER_PREFIX, struct default_include,
STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT): Move to
cppdefault.h.
(include_defaults_array): Move to cppdefault.c.
* cppdefault.h: New file.
* cppdefault.c: New file.
* Makefile.in (LIBCPP_OBJS): Add cppdefault.o.
(cppinit.o): Don't apply $(PREPROCESSOR_DEFINES) to this file.
(cppdefault.o): New rule; apply $(PREPROCESSOR_DEFINES) to
this file.
gslice_array.h, [...]: Do not paste anything after 'operator' keyword.
* std/gslice_array.h, std/indirect_array.h, std/mask_array.h,
std/slice_array.h, std/std_valarray.h, std/valarray_meta.h:
Do not paste anything after 'operator' keyword.
* bits/gslice_array.h, bits/indirect_array.h, bits/mask_array.h,
bits/slice_array.h, bits/std_valarray.h, bits/valarray_meta.h:
Do not paste anything after 'operator' keyword.
toplevel:
* cpplex.c: Don't include sys/mman.h.
(cpp_push_buffer, cpp_pop_buffer): Moved to cpplib.c.
* cpplib.c: Include sys/mman.h and obstack.h.
(cpp_push_buffer): Moved from cpplex.c; allocate buffers on an
obstack.
(cpp_pop_buffer): Moved from cpplex.c; free buffers from an obstack.
(_cpp_unwind_if_stack): Now static, unwind_if_stack. Don't
bother freeing if stack entries (they will be freed with their buffer).
(do_endif): Free if stack entries from the buffer obstack.
(push_conditional): Allocate if stack entries from the buffer obstack.
(find_answer): Rename to _cpp_find_answer.
(do_assert, do_unassert): Update.
* cppinit.c: Don't include hashtab.h or splay-tree.h.
(report_missing_guard): Moved to cppfiles.c.
(cpp_reader_init): Call cpp_init_stacks, cpp_init_macros,
cpp_init_includes.
(cpp_cleanup): Call cpp_cleanup_stacks, cpp_cleanup_macros,
cpp_cleanup_includes. Don't destroy hashtab or
all_include_files here.
(cpp_finish): Use _cpp_report_missing_guards.
* cppfiles.c (report_missing_guard): Moved from cppinit.c.
(_cpp_init_include_table): Rename _cpp_init_includes.
(_cpp_cleanup_includes, _cpp_report_missing_guards): New.
* cppexp.c (parse_assertion): Update for new name of
find_answer.
gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL stream argument on the first pass for CNI as...
* gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL
stream argument on the first pass for CNI as well as JNI.
(print_method_info): Set up method name on the first pass only.