From: Per Bothner Date: Tue, 2 Feb 1999 10:16:57 +0000 (-0800) Subject: jcf-write.c (localvar_alloc): Only emit entry for LocalVariableTable if debug_info_le... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=743b0973210c8b39331ecd5f10e2d77f24381321;p=gcc.git 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 --- diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c index 38d09b2a31f..9aed654a31c 100644 --- a/gcc/java/jvspec.c +++ b/gcc/java/jvspec.c @@ -160,6 +160,10 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) int saw_C = 0; int saw_o = 0; + /* Saw soem -O* or -g* option, respectively. */ + int saw_O = 0; + int saw_g = 0; + /* An array used to flag each argument that needs a bit set for LANGSPEC, MATHLIB, WITHLIBC, or GCLIB. */ int *args; @@ -274,6 +278,10 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) library = 0; will_link = 0; } + else if (argv[i][1] == 'g') + saw_g = 1; + else if (argv[i][1] == 'O') + saw_O = 1; else if (((argv[i][2] == '\0' && (char *)strchr ("bBVDUoeTuIYmLiA", argv[i][1]) != NULL) || strcmp (argv[i], "-Tdata") == 0)) @@ -389,6 +397,8 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) { lang_specific_extra_outfiles++; } + if (saw_g + saw_O == 0) + num_args++; arglist = (char **) xmalloc ((num_args + 1) * sizeof (char *)); for (i = 0, j = 0; i < argc; i++, j++) @@ -486,6 +496,10 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) } #endif + /* If we saw no -O or -g option, default to -g1, for javac compatibility. */ + if (saw_g + saw_O == 0) + arglist[j++] = "-g1"; + /* Add `-ljava' if we haven't already done so. */ if (library && ! saw_libjava) {