jvm.h (GCJ_40_BC_ABI_VERSION): New define.
authorTom Tromey <tromey@redhat.com>
Wed, 23 Mar 2005 20:27:12 +0000 (20:27 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Wed, 23 Mar 2005 20:27:12 +0000 (20:27 +0000)
libjava:
* include/jvm.h (GCJ_40_BC_ABI_VERSION): New define.
(_Jv_CheckABIVersion): Use it.
gcc/java:
* decl.c (GCJ_CURRENT_BC_ABI_VERSION): New define.
(parse_version): Use it.

From-SVN: r96948

gcc/java/ChangeLog
gcc/java/decl.c
libjava/ChangeLog
libjava/include/jvm.h

index 70ad11c36476bdc8ce69751234d9651782e93b09..16b956e0bb80699b93d03d61f7351898290e1ef2 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-23  Tom Tromey  <tromey@redhat.com>
+
+       * decl.c (GCJ_CURRENT_BC_ABI_VERSION): New define.
+       (parse_version): Use it.
+
 2005-03-23  Joseph S. Myers  <joseph@codesourcery.com>
 
        * lang.c (LANG_HOOKS_TRUTHVALUE_CONVERSION): Remove.
index 2f9da979733de03e0b30db1f0950e176c62cc9e7..d462f269640c37cf18bbccecb304b160175858de 100644 (file)
@@ -64,6 +64,13 @@ static void parse_version (void);
 /* Used when computing the ABI version.  */
 #define GCJ_BINARYCOMPAT_ADDITION 5
 
+/* The version of the BC ABI that we generate.  At the moment we are
+   compatible with what shipped in GCC 4.0.  This must be kept in sync
+   with parse_version(), libgcj, and reality (if the BC format
+   changes, this must change.  */
+#define GCJ_CURRENT_BC_ABI_VERSION \
+  (4 * 10000 + 0 * 10 + GCJ_BINARYCOMPAT_ADDITION)
+
 /* The ABI version number.  */
 tree gcj_abi_version;
 
@@ -609,7 +616,7 @@ parse_version (void)
      (objects generated by different version of gcj), but will
      probably always require strict matching for ordinary ABI.  */
   if (flag_indirect_dispatch)
-    abi_version += GCJ_BINARYCOMPAT_ADDITION;
+    abi_version = GCJ_CURRENT_BC_ABI_VERSION;
 
   gcj_abi_version = build_int_cstu (ptr_type_node, abi_version);
 }
index c3be587b67e0cfd781893f471a1baad3ba6b7b48..14c5079f3f91cb7131a550a7cbe0cead44b7fcf2 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-23  Tom Tromey  <tromey@redhat.com>
+       * include/jvm.h (GCJ_40_BC_ABI_VERSION): New define.
+       (_Jv_CheckABIVersion): Use it.
+
 2005-03-22  Mike Stump  <mrs@apple.com>
 
        * stacktrace.cc: Delete unused _Jv_FindCallingClassState.
index 62347880bb661fc67125b742be209ca68131ab50..7a5a4eaa28e0fb5027b34f377eb3d142d4996ffa 100644 (file)
@@ -562,14 +562,17 @@ extern void _Jv_RegisterBootstrapPackages ();
 #define GCJ_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 10)
 #define GCJ_BINARYCOMPAT_ADDITION 5
 
+// At present we know we are compatible with the BC ABI as used in GCC
+// 4.0.
+#define GCJ_40_BC_ABI_VERSION (4 * 10000 + 0 * 10 + GCJ_BINARYCOMPAT_ADDITION)
+
 inline bool
 _Jv_CheckABIVersion (unsigned long value)
 {
-  // For this release, recognize just our defined C++ ABI and our
-  // defined BC ABI.  (In the future we may recognize past BC ABIs as
-  // well.)
+  // Recognize our defined C++ ABI.
   return (value == GCJ_VERSION
-         || value == (GCJ_VERSION + GCJ_BINARYCOMPAT_ADDITION));
+         // At the moment this is the only BC ABI we recognize.
+         || value == GCJ_40_BC_ABI_VERSION);
 }
 
 // It makes the source cleaner if we simply always define this