OSDN Git Service

commit
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Feb 1999 10:16:57 +0000 (10:16 +0000)
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 2 Feb 1999 10:16:57 +0000 (10:16 +0000)
* 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).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24964 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/jvspec.c

index 38d09b2..9aed654 100644 (file)
@@ -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)
     {