aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce McKinlay <bryce@albatross.co.nz>2000-07-05 01:13:03 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2000-07-05 02:13:03 +0100
commit1bbee75bcc0d3948fb1e55da6a3547cddeb000a0 (patch)
treebf10374ec70a8e768334fa209b3f36b58a2f7e16
parent043afb2a089d22e59dd0a6e9d4bb2ca3aa342432 (diff)
downloadgcc-1bbee75bcc0d3948fb1e55da6a3547cddeb000a0.zip
gcc-1bbee75bcc0d3948fb1e55da6a3547cddeb000a0.tar.gz
gcc-1bbee75bcc0d3948fb1e55da6a3547cddeb000a0.tar.bz2
gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL stream argument on the first pass for CNI as...
* gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL stream argument on the first pass for CNI as well as JNI. (print_method_info): Set up method name on the first pass only. From-SVN: r34869
-rw-r--r--gcc/java/ChangeLog6
-rw-r--r--gcc/java/gjavah.c24
2 files changed, 20 insertions, 10 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index cd7b947..e7e2e0b 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,9 @@
+2000-07-02 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * gjavah.c (HANDLE_METHOD): Call print_method_info with a NULL stream
+ argument on the first pass for CNI as well as JNI.
+ (print_method_info): Set up method name on the first pass only.
+
2000-06-29 Alexandre Petit-Bianco <apbianco@cygnus.com>
* jcf-write.c (push_long_const): Appropriately cast short negative
diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c
index 3c04ebf..b8a37f7 100644
--- a/gcc/java/gjavah.c
+++ b/gcc/java/gjavah.c
@@ -189,9 +189,12 @@ static int method_printed = 0;
if (out) \
print_method_info (out, jcf, NAME, SIGNATURE, ACCESS_FLAGS); \
} \
- else if (flag_jni) \
- print_method_info (NULL, jcf, NAME, SIGNATURE, ACCESS_FLAGS); \
- else if (! stubs) add_class_decl (out, jcf, SIGNATURE);
+ else \
+ { \
+ print_method_info (NULL, jcf, NAME, SIGNATURE, ACCESS_FLAGS); \
+ if (! stubs && ! flag_jni) \
+ add_class_decl (out, jcf, SIGNATURE); \
+ }
#define HANDLE_CODE_ATTRIBUTE(MAX_STACK, MAX_LOCALS, CODE_LENGTH) \
if (out && method_declared) decompile_method (out, jcf, CODE_LENGTH);
@@ -665,6 +668,7 @@ DEFUN(print_field_info, (stream, jcf, name_index, sig_index, flags),
free (override);
}
+
static void
DEFUN(print_method_info, (stream, jcf, name_index, sig_index, flags),
FILE *stream AND JCF* jcf
@@ -700,7 +704,10 @@ DEFUN(print_method_info, (stream, jcf, name_index, sig_index, flags),
else
return;
}
- else
+
+ /* During the first method pass, build a list of method names. This will
+ be used to determine if field names conflict with method names. */
+ if (! stream)
{
struct method_name *nn;
@@ -714,14 +721,11 @@ DEFUN(print_method_info, (stream, jcf, name_index, sig_index, flags),
memcpy (nn->signature, JPOOL_UTF_DATA (jcf, sig_index),
nn->sig_length);
method_name_list = nn;
+
+ /* The rest of this function doesn't matter. */
+ return;
}
- /* If we're not printing, then the rest of this function doesn't
- matter. This happens during the first method pass in JNI mode.
- Eww. */
- if (! stream)
- return;
-
/* We don't worry about overrides in JNI mode. */
if (! flag_jni)
{