[ecj] Patch: FYI: document -fsource and -ftarget + change defaults

Tom Tromey tromey@redhat.com
Fri Jun 23 18:42:00 GMT 2006


I'm checking this in on the gcj-eclipse branch.

This sets the default source version to 1.5.  It also changes the
specs so that we always emit 1.5 bytecode when we are going to compile
the bytecode to object code.  This results in better code for the
'foo.class' construct.

This also documents the new -fsource and -ftarget options.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* lang-specs.h: Default -fsource and -ftarget to 1.5.  If
	emitting class files, always use 1.5.
	* gcj.texi (Input Options): Document -fsource.
	(Code Generation): Document -ftarget.

Index: lang-specs.h
===================================================================
--- lang-specs.h	(revision 114870)
+++ lang-specs.h	(working copy)
@@ -42,8 +42,8 @@
       %{fdisable-assertions*}						\
       %{fencoding*} %{ffilelist-file}					\
       %{foutput-class-dir*} %{g*}					\
-      %{fsource*} %{!fsource*:-fsource=1.4}				\
-      %{ftarget*} %{!ftarget*:-ftarget=1.4}				\
+      %{fsource*} %{!fsource*:-fsource=1.5}				\
+      %{ftarget*} %{!femit-class-files|!ftarget*:-ftarget=1.5}		\
       %{!findirect-dispatch:-fzip-dependency=%U.zip}			\
       %{!fsyntax-only:-fzip-target=%U.jar}}\n				\
     %{.class|.zip|.jar|!fsyntax-only:jc1				\
Index: gcj.texi
===================================================================
--- gcj.texi	(revision 114870)
+++ gcj.texi	(working copy)
@@ -305,6 +305,10 @@
 This forces the compiler to always check for the special zero length
 attribute @code{gnu.gcj.gcj-compiled} in @code{java.lang.Object} and
 issue an error if it isn't found.
+
+@item -fsource=@var{VERSION}
+This option is used to choose the source version accepted by
+@command{gcj}.  The default is @samp{1.5}.
 @end table
 
 @node Encodings
@@ -457,6 +461,11 @@
 The actual file name to be compiled this way must be specified
 separately.
 
+@item -ftarget=@var{VERSION}
+This can be used with @option{-C} to choose the version of bytecode
+emitted by @command{gcj}.  The default is @samp{1.5}.  When not
+generating bytecode, this option has no effect.
+
 @item -d @var{directory}
 When used with @code{-C}, this causes all generated @file{.class} files
 to be put in the appropriate subdirectory of @var{directory}.  By



More information about the Gcc-patches mailing list