This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[java] Convert Java options to use Var() initialization
- From: Kelley Cook <kcook at gcc dot gnu dot org>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, GCJ-patches <java-patches at gcc dot gnu dot org>
- Date: Wed, 21 Jul 2004 10:53:09 -0400
- Subject: [java] Convert Java options to use Var() initialization
- Hop-count: 1
This just follows the pattern established in
http://gcc.gnu.org/ml/gcc-patches/2004-06/msg00820.html and
http://gcc.gnu.org/ml/gcc/2004-06/msg01541.html.
It converts the Java FE to use the new Var() and Init() options instead
of having to explicitly initialize and defining each variable.
Tested with a bootstrap and testsuite w/libjava under
powerpc-apple-darwin6.8 & pentium4-pc-cygwin.
OK for mainline?
2004-07-07 Kelley Cook <kcook@gcc.gnu.org>
* lang.c (flag_emit_class_files, flag_filelist_file, flag_redundant,
flag_use_divide_subroutine, flag_use_boehm_gc, flag_store_check,
flag_hash_synchronization, flag_assert, flag_jni, flag_newer,
flag_check_references, flag_extraneous_semicolon, flag_deprecated,
flag_force_classes_archive_check, flag_optimize_sci,
flag_indirect_dispatch): Remove explicit declarations.
* lang.opt: Add implicit declare/define/assign. Remove obsolete
final comment.
diff -prcd ../../../gcc-orig/gcc/java/lang.c ./lang.c
*** ../../../gcc-orig/gcc/java/lang.c Tue Jul 6 09:55:21 2004
--- ./lang.c Wed Jul 7 09:23:00 2004
*************** int compiling_from_source;
*** 117,128 ****
const char *resource_name;
- int flag_emit_class_files = 0;
-
- /* Nonzero if input file is a file with a list of filenames to compile. */
-
- int flag_filelist_file = 0;
-
/* When nonzero, we emit xref strings. Values of the flag for xref
backends are defined in xref_flag_table, xref.c. */
--- 117,122 ----
*************** int flag_emit_xref = 0;
*** 131,187 ****
/* When nonzero, -Wall was turned on. */
int flag_wall = 0;
- /* When nonzero, check for redundant modifier uses. */
- int flag_redundant = 0;
-
- /* When nonzero, call a library routine to do integer divisions. */
- int flag_use_divide_subroutine = 1;
-
- /* When nonzero, generate code for the Boehm GC. */
- int flag_use_boehm_gc = 0;
-
- /* When nonzero, assume the runtime uses a hash table to map an
- object to its synchronization structure. */
- int flag_hash_synchronization;
-
- /* When nonzero, permit the use of the assert keyword. */
- int flag_assert = 1;
-
- /* When nonzero, assume all native functions are implemented with
- JNI, not CNI. */
- int flag_jni = 0;
-
- /* When nonzero, warn when source file is newer than matching class
- file. */
- int flag_newer = 1;
-
- /* When nonzero, generate checks for references to NULL. */
- int flag_check_references = 0;
-
/* The encoding of the source file. */
const char *current_encoding = NULL;
- /* When nonzero, report the now deprecated empty statements. */
- int flag_extraneous_semicolon;
-
- /* When nonzero, report use of deprecated classes, methods, or fields. */
- int flag_deprecated = 1;
-
- /* When nonzero, always check for a non gcj generated classes archive. */
- int flag_force_classes_archive_check;
-
- /* When zero, don't optimize static class initialization. This flag shouldn't
- be tested alone, use STATIC_CLASS_INITIALIZATION_OPTIMIZATION_P instead. */
- /* FIXME: Make this work with gimplify. */
- int flag_optimize_sci = 0;
-
- /* When nonzero, use offset tables for virtual method calls
- in order to improve binary compatibility. */
- int flag_indirect_dispatch = 0;
-
- /* When zero, don't generate runtime array store checks. */
- int flag_store_check = 1;
-
/* When nonzero, print extra version information. */
static int v_flag = 0;
--- 125,133 ----
*************** java_handle_option (size_t scode, const
*** 280,288 ****
switch (code)
{
- default:
- abort();
-
case OPT_I:
jcf_path_include_arg (arg);
break;
--- 226,231 ----
*************** java_handle_option (size_t scode, const
*** 330,355 ****
set_Wunused (value);
break;
- case OPT_Wdeprecated:
- flag_deprecated = value;
- break;
-
- case OPT_Wextraneous_semicolon:
- flag_extraneous_semicolon = value;
- break;
-
- case OPT_Wout_of_date:
- flag_newer = value;
- break;
-
- case OPT_Wredundant_modifiers:
- flag_redundant = value;
- break;
-
- case OPT_fassert:
- flag_assert = value;
- break;
-
case OPT_fenable_assertions_:
add_enable_assert (arg, value);
break;
--- 273,278 ----
*************** java_handle_option (size_t scode, const
*** 378,387 ****
jcf_path_bootclasspath_arg (arg);
break;
- case OPT_fcheck_references:
- flag_check_references = value;
- break;
-
case OPT_fclasspath_:
case OPT_fCLASSPATH_:
jcf_path_classpath_arg (arg);
--- 301,306 ----
*************** java_handle_option (size_t scode, const
*** 396,406 ****
return 0;
break;
- case OPT_femit_class_file:
- case OPT_femit_class_files:
- flag_emit_class_files = value;
- break;
-
case OPT_fencoding_:
current_encoding = arg;
break;
--- 315,320 ----
*************** java_handle_option (size_t scode, const
*** 409,462 ****
jcf_path_extdirs_arg (arg);
break;
- case OPT_ffilelist_file:
- flag_filelist_file = value;
- break;
-
- case OPT_fforce_classes_archive_check:
- flag_force_classes_archive_check = value;
- break;
-
- case OPT_fhash_synchronization:
- flag_hash_synchronization = value;
- break;
-
- case OPT_findirect_dispatch:
- flag_indirect_dispatch = value;
- break;
-
case OPT_finline_functions:
flag_inline_functions = value;
flag_really_inline = value;
break;
- case OPT_fjni:
- flag_jni = value;
- break;
-
- case OPT_foptimize_static_class_initialization:
- flag_optimize_sci = value;
- break;
-
case OPT_foutput_class_dir_:
jcf_write_base_directory = arg;
break;
- case OPT_fstore_check:
- flag_store_check = value;
- break;
-
- case OPT_fuse_boehm_gc:
- flag_use_boehm_gc = value;
- break;
-
- case OPT_fuse_divide_subroutine:
- flag_use_divide_subroutine = value;
- break;
-
case OPT_version:
v_flag = 1;
break;
}
return 1;
--- 323,345 ----
jcf_path_extdirs_arg (arg);
break;
case OPT_finline_functions:
flag_inline_functions = value;
flag_really_inline = value;
break;
case OPT_foutput_class_dir_:
jcf_write_base_directory = arg;
break;
case OPT_version:
v_flag = 1;
break;
+
+ default:
+ if (cl_options[code].flags & CL_Java)
+ break;
+ abort();
}
return 1;
diff -prcd ../../../gcc-orig/gcc/java/lang.opt ./lang.opt
*** ../../../gcc-orig/gcc/java/lang.opt Thu May 13 02:40:36 2004
--- ./lang.opt Wed Jul 7 10:23:00 2004
*************** Java
*** 62,80 ****
; Documented for C
Wdeprecated
! Java
Warn if deprecated class, method, or field is used
Wextraneous-semicolon
! Java
Warn if deprecated empty statements are found
Wout-of-date
! Java
Warn if .class files are out of date
Wredundant-modifiers
! Java
Warn if modifiers are specified when not necessary
fCLASSPATH=
--- 62,80 ----
; Documented for C
Wdeprecated
! Java Var(flag_deprecated) Init(1)
Warn if deprecated class, method, or field is used
Wextraneous-semicolon
! Java Var(flag_extraneous_semicolon)
Warn if deprecated empty statements are found
Wout-of-date
! Java Var(flag_newer) Init(1)
Warn if .class files are out of date
Wredundant-modifiers
! Java Var(flag_redundant)
Warn if modifiers are specified when not necessary
fCLASSPATH=
*************** Java JoinedOrMissing RejectNegative
*** 82,88 ****
--CLASSPATH Deprecated; use --classpath instead
fassert
! Java
fassume-compiled
Java
--- 82,89 ----
--CLASSPATH Deprecated; use --classpath instead
fassert
! Java Var(flag_assert) Init(1)
! Permit the use of the assert keyword
fassume-compiled
Java
*************** Java JoinedOrMissing RejectNegative
*** 107,113 ****
--bootclasspath=<path> Replace system path
fcheck-references
! Java
fclasspath=
Java JoinedOrMissing RejectNegative
--- 108,115 ----
--bootclasspath=<path> Replace system path
fcheck-references
! Java Var(flag_check_references)
! Generate checks for references to NULL
fclasspath=
Java JoinedOrMissing RejectNegative
*************** fcompile-resource=
*** 117,126 ****
Java Joined RejectNegative
femit-class-file
! Java
femit-class-files
! Java
fencoding=
Java Joined RejectNegative
--- 119,130 ----
Java Joined RejectNegative
femit-class-file
! Java Var(flag_emit_class_files) VarExists
! Output a class file
femit-class-files
! Java Var(flag_emit_class_files)
! Alias for -femit-class-file
fencoding=
Java Joined RejectNegative
*************** fextdirs=
*** 130,173 ****
Java Joined RejectNegative
ffilelist-file
! Java
fforce-classes-archive-check
! Java
Always check for non gcj generated classes archives
fhash-synchronization
! Java
findirect-dispatch
! Java
Use offset tables for virtual method calls
finline-functions
Java
fjni
! Java
Assume native functions are implemented using JNI
foptimize-static-class-initialization
! Java
Enable optimization of static class initialization code
foutput-class-dir=
Java Joined RejectNegative
fstore-check
! Java
Enable assignability checks for stores into object arrays
fuse-boehm-gc
! Java
fuse-divide-subroutine
! Java
version
Java
-
- ; This comment is to ensure we retain the blank line above.
--- 134,179 ----
Java Joined RejectNegative
ffilelist-file
! Java Var(flag_filelist_file)
! Input file is a file with a list of filenames to compile
fforce-classes-archive-check
! Java Var(flag_force_classes_archive_check)
Always check for non gcj generated classes archives
fhash-synchronization
! Java Var(flag_hash_synchronization)
! Assume the runtime uses a hash table to map an object to its synchronization structure
findirect-dispatch
! Java Var(flag_indirect_dispatch)
Use offset tables for virtual method calls
finline-functions
Java
fjni
! Java Var(flag_jni)
Assume native functions are implemented using JNI
foptimize-static-class-initialization
! Java Var(flag_optimize_sci)
Enable optimization of static class initialization code
foutput-class-dir=
Java Joined RejectNegative
fstore-check
! Java Var(flag_store_check) Init(1)
Enable assignability checks for stores into object arrays
fuse-boehm-gc
! Java Var(flag_use_boehm_gc)
! Generate code for the Boehm GC
fuse-divide-subroutine
! Java Var(flag_use_divide_subroutine) Init(1)
! Call a library routine to do integer divisions
version
Java