Commit Graph

73 Commits

Author SHA1 Message Date
Kaveh R. Ghazi
c2e3db9254 gjavah.c (get_field_name, [...]): Use xmalloc, not malloc.
* gjavah.c (get_field_name, print_method_info, print_include,
	add_namelet): Use xmalloc, not malloc.

	* jcf-depend.c (add_entry): Likewise.  Use xstrdup, not strdup.
	(munge): Use xrealloc, not realloc, trust xrealloc to handle a
	NULL pointer.

	* jcf-io.c (open_in_zip, find_class): Use xstrdup, not strdup.

	* jcf-parse.c (jcf_out_of_synch, yyparse): Likewise.

	* jcf-path.c (add_entry): Likewise.

	* jcf.h (ALLOC, REALLOC): Use xmalloc/xrealloc, not malloc/realloc.

	* jv-scan.c (xmalloc): Remove definition.

	* jvgenmain.c (xmalloc): Likewise.

	* jvspec.c (lang_specific_driver): Use xcalloc, not xmalloc/bzero.

	* lex.c (java_store_unicode): Use xrealloc, not realloc.

	* parse-scan.y: Use concat, not of xmalloc/assign/strcpy.  Use
	concat, not xmalloc/sprintf.
	(java_push_parser_context): Use xcalloc, not xmalloc/bzero.
	(xstrdup): Remove definition.

	* parse.y (duplicate_declaration_error_p,
	constructor_circularity_msg, verify_constructor_circularity,
	check_abstract_method_definitions, java_check_regular_methods,
	java_check_abstract_methods, patch_method_invocation,
	check_for_static_method_reference, patch_assignment, patch_binop,
	patch_cast, array_constructor_check_entry, patch_return,
	patch_conditional_expr): Use xstrdup, not strdup.

	* zextract.c (ALLOC): Use xmalloc, not malloc.

From-SVN: r29457
1999-09-16 15:45:15 +00:00
Kaveh R. Ghazi
9257393c20 Makefile.in (gcc.o, [...]): Depend on gcc.h.
* Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h.

	* gcc.h: New file.
	(lang_specific_driver): Don't take a function pointer parameter.
	All callers changed.

	* gcc.c: Include gcc.h.
	(do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link,
	lang_specific_extra_outfiles, fatal): Don't declare.
	(multilib_defaults_raw): Constify.
	(read_specs): Call memset, rather than bzero.
	(main): Call return, not exit.
	(lookup_compiler): Call memcpy, not bcopy.
	(fatal): Make extern.

	* cppspec.c: Include gcc.h.
	(lang_specific_driver): Initialize variable `quote'.  Constify a
	char*.  All calls to the function pointer parameter now
	explicitly call `fatal'.

	* gccspec.c (lang_specific_driver): Include gcc.h.

cp:

	* Make-lang.in (g++spec.o): Depend on system.h and gcc.h.

	* g++spec.c: Include gcc.h.
	(lang_specific_driver): Constify a char*.  Call xcalloc, not
 	xmalloc/bzero.  All calls to the function pointer parameter now
 	explicitly call `fatal'.

f:

	* Make-lang.in (g77spec.o): Depend on system.h and gcc.h.

	* g77spec.c: Include gcc.h.
	(g77_xargv): Constify.
	(g77_fn): Add parameter prototypes.
	(lookup_option, append_arg): Add static prototypes.
	(g77_newargv): Constify.
	(lookup_option, append_arg, lang_specific_driver): Constify a char*.
	(lang_specific_driver): All calls to the function pointer
 	parameter now explicitly call `fatal'.

java:

	* Make-lang.in (jvspec.o): Depend on system.h and gcc.h.

	* jvspec.c: Include gcc.h.  Don't include gansidecl.h.
	(do_spec, lang_specific_pre_link, lang_specific_driver,
	input_filename, input_filename_length): Don't declare.
	(main_class_name, jvgenmain_spec, lang_specific_driver):
	Constify a char*.
	(lang_specific_driver): All calls to the function pointer
	parameter now explicitly call `fatal'.

From-SVN: r29367
1999-09-13 03:57:40 +00:00
Tom Tromey
20c96b2a12 * jvspec.c (lang_specific_driver): Correctly handle --help again.
From-SVN: r28869
1999-08-25 18:37:05 +00:00
Kaveh R. Ghazi
be245ac0a0 gjavah.c (print_name, [...]): Add static prototype.
* gjavah.c (print_name, print_base_classname, utf8_cmp,
	cxx_keyword_subst, generate_access, name_is_method_p,
	get_field_name, print_field_name, super_class_name, print_include,
	decode_signature_piece, print_class_decls, usage, help,
	java_no_argument, version, add_namelet, print_namelet): Add static
	prototype.
	(print_base_classname, utf8_cmp, cxx_keyword_subst,
	name_is_method_p): Constify a char*.
	(get_field_name): Likewise.  Prefer xstrdup over malloc/strcpy.
	Provide a final else clause in an if-else-if.
	(print_field_info): Add missing final arg in function call to
	`print_field_name'.
	(print_method_info, decompile_method, decode_signature_piece,
	print_c_decl, print_full_cxx_name, print_stub,
	print_mangled_classname, super_class_name, print_include,
	add_namelet, add_class_decl, print_class_decls, process_file,
	help): Constify a char*.

	* jcf-write.c (jcf_handler, push_constant1, push_constant2,
	push_int_const, find_constant_wide, find_constant_index,
	push_long_const, field_op, maybe_wide, emit_dup, emit_pop,
	emit_iinc, emit_load_or_store, emit_load, emit_store, emit_unop,
	emit_binop, emit_reloc, emit_switch_reloc, emit_case_reloc,
	emit_if, emit_goto, emit_jsr, call_cleanups,
	make_class_file_name): Add static prototypes.
	(generate_bytecode_return, generate_bytecode_insns): Pass a
	NULL_PTR, not a NULL_TREE.

	* jv-scan.c: Include "jcf.h".
	(main): Declare using DEFUN macro.

	* jvspec.c (find_spec_file, lang_specific_pre_link,
	lang_specific_driver): Add prototypes.
	(find_spec_file): Constify a char*.

	* keyword.gperf (hash, java_keyword): Add prototypes.

	* lang.c (lang_print_error): Add static prototype.
	(lang_init): Prefer memcpy over bcopy to avoid casts.

	* lex.c (yylex): Add static prototype.

	* parse-scan.y: Include "lex.c" earlier.

	* parse.h: Remove redundant declaration for `yylex'.

	* parse.y (java_decl_equiv, binop_compound_p, search_loop,
	labeled_block_contains_loop_p): Add static prototypes.
	(not_accessible_p): Make static to match prototype.

	* verify.c (start_pc_cmp): Don't needlessly cast away const.

From-SVN: r28862
1999-08-25 13:59:28 +00:00
Andrew Haley
0b094f655a lang.c (flag_use_divide_subroutine): New variable.
1999-07-15  Andrew Haley  <aph@cygnus.com>

        * lang.c (flag_use_divide_subroutine): New variable.
        * typeck.c: (convert_ieee_real_to_integer): Bounds check
        fp-to-integer conversion.
        (convert): Call convert_ieee_real_to_integer when flag_fast_math
        is not set.

        * expr.c (build_java_soft_divmod): New function.
        (build_java_binop): Call build_java_soft_divmod if
        flag_use_divide_subroutine is set.
        * decl.c: soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
        soft_lrem_node: new builtin functions.
        (init_decl_processing) Initialize the new builtins.
        * java-tree.h soft_idiv_node, soft_irem_node, soft_ldiv_node, tree
        soft_lrem_node: new builtin functions.
        (build_java_soft_divmod): New function.
        * parse.y: Call build_java_soft_divmod if
        flag_use_divide_subroutine is set.
        * parse.c: Rebuilt.

        * jvspec.c (lang_specific_driver): Always allow an extra arg (for
        a --specs= arg) even if not linking.
        * lang-options.h (DEFINE_LANG_NAME ("Java")): Add
        -fuse-divide-subroutine

From-SVN: r28209
1999-07-21 14:51:24 +00:00
Tom Tromey
4198d73419 * jvspec.c (lang_specific_driver): Recognize --help.
From-SVN: r27814
1999-06-28 11:34:35 +00:00
Kaveh R. Ghazi
ab3a6dd6e2 Warning fixes:
* class.c (build_utf8_ref): Initialize variable `field'.
        * decl.c (init_decl_processing): Initialize variable `field'.
        * expr.c (build_known_method_ref): Mark parameters `method_type',
        `method_signature' and `arg_list' with ATTRIBUTE_UNUSED.
        (process_jvm_instruction): Likewise for parameter `length'.
        * jvspec.c (lang_specific_driver): Mark variables `saw_math',
        `saw_libc', `saw_gc', `saw_threadlib' and `saw_libgcj' with
        ATTRIBUTE_UNUSED.
        * parse.y (maybe_generate_clinit): Remove unused variable
        `has_non_primitive_fields'.
        (find_in_imports_on_demand): Initialize variables `node_to_use'
        and `cl'.
        (patch_binop): Likewise for variable `prom_type'.
        (patch_unaryop): Likewise for variable `prom_type'.
        * verify.c (verify_jvm_instructions): Likewise for variable `last'.
        * xref.c (xref_table): Add missing initializer.

From-SVN: r27030
1999-05-19 11:30:30 +00:00
Tom Tromey
6a09296d7a Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x flags.
* Make-lang.in (jvspec.o): Don't define WITH_THREAD_x or WITH_GC_x
	flags.
	* jvspec.c (THREAD_NAME): Removed.
	(GC_NAME): Likewise.
	(MATHLIB): Likewise.
	(WITHLIBC): Likewise.
	(GCLIB): Likewise.
	(THREADLIB): Likewise.
	(MATH_LIBRARY): Likewise.
	(lang_specific_driver): Don't add `-l' options to command line.
	Instead, add a single --specs option.  Recognize `-L' options and
	use them to search for spec file.
	(find_spec_file): New function.
	(SPEC_FILE): New define.

From-SVN: r26883
1999-05-11 12:00:35 +00:00
Kaveh R. Ghazi
9ee9b55502 Warning fixes:
* gjavah.c (print_c_decl): Remove unused argument `flags'.
        * jcf-dump.c (print_access_flags): Add braces around if-else.
        * jvspec.c (lang_specific_driver): Wrap variable `len' in macro
        COMBINE_INPUTS.
        * lex.c (build_wfl_node): Add static prototype.
        * lex.h (build_wfl_node): Remove static prototype.
        * parse.y: Include lex.c early enough to declare everything needed.
        Ensure calls to `build_wfl_node' pass the proper arguments.
        (create_class): Remove unused variable `super_decl'.
        (get_printable_method_name): Initialize variable `name'.

From-SVN: r25921
1999-03-23 07:24:15 +00:00
Tom Tromey
4e2e5821aa jvspec.c (lang_specific_driver): Recognize -fsyntax-only and disable linking in that case.
* jvspec.c (lang_specific_driver): Recognize -fsyntax-only and
	disable linking in that case.

From-SVN: r25389
1999-02-23 17:42:38 +00:00
Jeffrey A Law
e860aea39d jvspec.c (xmalloc): Kill the prototype.
* jvspec.c (xmalloc): Kill the prototype.  It does not belong
        here anymore.

From-SVN: r25141
1999-02-10 15:28:58 -07:00
Tom Tromey
00368bdd0f jvspec.c (lang_specific_driver): Use libgcj, not libjava.
* jvspec.c (lang_specific_driver): Use libgcj, not libjava.
	* Makefile.in (jcf-path.o): Define LIBGCJ_ZIP_FILE.
	(libgcj_zip): Renamed.
	* jcf-path.c (add_entry): Use LIBGCJ_ZIP_FILE, not
	LIBJAVA_ZIP_FILE.
	(jcf_path_init): Use LIBGCJ_ZIP_FILE.

From-SVN: r25136
1999-02-10 14:27:53 +00:00
Tom Tromey
0ffe9eeafa jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
* jvspec.c (THREAD_NAME): Renamed -lqthreads to -lgcjcoop.
	(GC_NAME): Renamed -lgc to -lgcjgc.

From-SVN: r25135
1999-02-10 14:05:24 +00:00
Kaveh R. Ghazi
b0f780c3bf jvspec.c (xmalloc): Fix the prototype to match the one obtained from libiberty.h
* jvspec.c (xmalloc): Fix the prototype to match the one obtained
        from libiberty.h

From-SVN: r24975
1999-02-02 17:16:58 +00:00
Per Bothner
e77dbc56f9 Fix typo in comment.
From-SVN: r24966
1999-02-02 02:18:25 -08:00
Per Bothner
743b097321 jcf-write.c (localvar_alloc): Only emit entry for LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
0
	* jcf-write.c (localvar_alloc):  Only emit entry for
	LocalVariableTable if debug_info_level > DINFO_LEVEL_TERSE.
	(generate_bytecode_insns):  Only call put_linenumber if
	debug_info_level > DINFO_LEVEL_NONE.
	* jvspec.c (lang_specific_driver):  If no -O* or -g* option
	is specified, add -g1 (for compatibility wih javac).

From-SVN: r24964
1999-02-02 02:16:57 -08:00
Kaveh R. Ghazi
45254bf682 Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
* Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
        * jv-scan.c: Fix xmalloc prototype.  Provide an xmalloc definition.
        * jvgenmain.c: Remove the xmalloc prototype, we get it from
        libiberty.h.  Provide an xmalloc definition.
        * jvspec.c: Remove the xmalloc prototype.
        * parse-scan.y: Include config.h and system.h.  Don't include
        OS headers or gansidecl.h.  Don't prototype xmalloc/xstrdup.
        Provide an xstrdup definition.

From-SVN: r23934
1998-11-27 10:25:17 +00:00
Tom Tromey
df66b5660c gjavah.c (main): Handle --output-class-directory argument.
* gjavah.c (main): Handle --output-class-directory argument.
	* jvspec.c (lang_specific_driver): Translate `-d' into
	-foutput-class-dir.
	* jcf.h (jcf_write_base_directory): Declare.
	* lang.c (lang_decode_option): Recognize -foutput-class-dir.
	* lang-options.h: Mention -foutput-class-dir.
	* jcf-write.c (jcf_write_base_directory): New global.
	(make_class_file_name): Put generated .class file into `-d'
	directory, or into source directory if -d not given.  Function now
	static.
	(write_classfile): Free class file name.  Handle case where class
	file name is NULL.
	(DIR_SEPARATOR): New macro.
	Include <sys/stat.h>

From-SVN: r23640
1998-11-13 14:09:53 +00:00
Tom Tromey
dfded5c3ba jvspec.c (lang_specific_driver): Correctly handle case where GC_NAME not defined.
* jvspec.c (lang_specific_driver): Correctly handle case where
	GC_NAME not defined.

From-SVN: r23614
1998-11-12 08:50:52 +00:00
Tom Tromey
aaff4ee49e jvspec.c (GC_NAME): New define.
* jvspec.c (GC_NAME): New define.
	(lang_specific_driver): Use GC_NAME.  Add GC_NAME to command line
	if required.
	* Make-lang.in (jvspec.o): Define WITH_GC_<name>.

From-SVN: r23612
1998-11-11 22:48:27 +00:00
Per Bothner
1938bea67e jvspecs.c: Add (but don't enable) support for combining multiple .class and .java input...
�
	* jvspecs.c:  Add (but don't enable) support for combining multiple
	.class and .java input filenames to a single jc1 invocation.
	Add support for -C flag (copile to .class files).
	Translate -classpath and -CLASSPATH arguments.
	* lang-specs.h:  Don't set %2 spec.

From-SVN: r23238
1998-10-22 16:11:53 -07:00
Per Bothner
8376a32eb1
Merge from Cygnus internal source tree.

From-SVN: r23024
1998-10-12 05:43:52 -07:00
Anthony Green
e04a16fbee Initial revision
From-SVN: r22299
1998-09-06 15:36:06 +00:00