This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[ecj] Patch: FYI: document -fsource and -ftarget + change defaults
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: 23 Jun 2006 12:15:55 -0600
- Subject: [ecj] Patch: FYI: document -fsource and -ftarget + change defaults
- Reply-to: tromey at redhat dot com
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