summaryrefslogtreecommitdiff
path: root/gcc/java/gjavah.c
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-06 01:45:47 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-06 01:45:47 +0000
commit8b3bea94de3993a42243591db123fbd6f16e1096 (patch)
tree45363ed5e9154746dc287f74e62b19db6aa11e99 /gcc/java/gjavah.c
parentdbcad757ec15e746e662e38b72b08ab1f8fdb7a3 (diff)
downloadgcc-8b3bea94de3993a42243591db123fbd6f16e1096.tar.gz
* jvspec.c (jvgenmain_spec): Added `-fdollars-in-identifiers'.
* jvgenmain.c (class_mangling_prefix): Removed. (class_mangling_suffix): New global. (main): Use it. * gjavah.c (cxx_keyword_subst): Mangle C++ keywords by appending `$'. (print_method_info): Handle overrides for static and final methods. (process_file): Generate declaration for class object field. * class.c (cxx_keywords): New array. (utf8_cmp): New function. (cxx_keyword_p): New function. (layout_class_method): Mangle C++ keywords by appending `$'. (mangle_field): New function. (mangle_class_field): Use mangle_field. Mangle class name as `class$'. (mangle_static_field): Use mangle_field. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36738 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/gjavah.c')
-rw-r--r--gcc/java/gjavah.c31
1 files changed, 11 insertions, 20 deletions
diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c
index 3dc42178887..a25788a4361 100644
--- a/gcc/java/gjavah.c
+++ b/gcc/java/gjavah.c
@@ -440,9 +440,9 @@ cxx_keyword_subst (str, length)
if (r == 0)
{
- char *str = xmalloc (9 + strlen (cxx_keywords[mid]));
- strcpy (str, "__dummy_");
- strcat (str, cxx_keywords[mid]);
+ char *str = xmalloc (2 + strlen (cxx_keywords[mid]));
+ strcpy (str, cxx_keywords[mid]);
+ strcat (str, "$");
return str;
}
else if (r < 0)
@@ -759,18 +759,6 @@ DEFUN(print_method_info, (stream, jcf, name_index, sig_index, flags, synth),
(not only for calls to this function for for other functions
after it in the vtbl). So we give it a dummy name instead. */
override = cxx_keyword_subst (str, length);
- if (override)
- {
- /* If the method is static or final, we can safely skip it.
- If we don't skip it then we'll have problems since the
- mangling will be wrong. FIXME. */
- if (METHOD_IS_FINAL (jcf->access_flags, flags)
- || (flags & ACC_STATIC))
- {
- free (override);
- return;
- }
- }
}
if (! stubs && ! flag_jni)
@@ -1844,9 +1832,9 @@ DEFUN(process_file, (jcf, out),
{
if (flag_jni)
{
- fprintf (out, "\n#ifdef __cplusplus\n");
- fprintf (out, "}\n");
- fprintf (out, "#endif\n");
+ fprintf (out, "\n#ifdef __cplusplus\n");
+ fprintf (out, "}\n");
+ fprintf (out, "#endif\n");
}
else
{
@@ -1860,8 +1848,11 @@ DEFUN(process_file, (jcf, out),
for (i = 0; i < add_count; ++i)
fprintf (out, " %s\n", add_specs[i]);
- if (! stubs)
- fputs ("};\n", out);
+ /* Generate an entry for the class object. */
+ generate_access (out, ACC_PUBLIC);
+ fprintf (out, "\n static ::java::lang::Class class$;\n");
+
+ fputs ("};\n", out);
if (append_count > 0)
fputc ('\n', out);