This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: set some decl names
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 07 Mar 2005 17:50:22 -0700
- Subject: [gcjx] Patch: FYI: set some decl names
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
This sets some DECL_NAMEs where needed.
As I recall this avoids crashes.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* builtins.cc (map_class_object): Mark class object as public.
Set name of decl.
(get_vtable_decl): Likewise.
Index: builtins.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/builtins.cc,v
retrieving revision 1.1.2.12
diff -u -r1.1.2.12 builtins.cc
--- builtins.cc 8 Mar 2005 00:34:36 -0000 1.1.2.12
+++ builtins.cc 8 Mar 2005 00:51:29 -0000
@@ -151,7 +151,8 @@
|| meth->final_p ())
DECL_INLINE (result) = 1;
if (meth->native_p ())
- DECL_EXTERNAL (result) = 1; // FIXME wrong..?
+ DECL_EXTERNAL (result) = 1;
+ // FIXME: if we're not compiling this method, set DECL_EXTERNAL.
methodmap[meth] = result;
}
@@ -171,7 +172,7 @@
map_identifier (field->get_name ()),
map_type (field->type ()));
DECL_CONTEXT (result) = context;
- DECL_EXTERNAL (result) = 1;
+ DECL_EXTERNAL (result) = 1; // FIXME unless we're compiling it...
TREE_PUBLIC (result) = 1;
if (field->static_p ())
SET_DECL_ASSEMBLER_NAME (result,
@@ -259,12 +260,13 @@
if (classobj_map.find (klass) == classobj_map.end ())
{
tree decl = build_decl (VAR_DECL, NULL_TREE, type_class);
+ TREE_PUBLIC (decl) = 1;
TREE_STATIC (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
DECL_IGNORED_P (decl) = 1;
- // FIXME: DECL_EXTERNAL ?
SET_DECL_ASSEMBLER_NAME (decl,
get_identifier (get_class_object_name (klass).c_str ()));
+ DECL_NAME (decl) = DECL_ASSEMBLER_NAME (decl);
classobj_map[klass] = decl;
}
@@ -478,12 +480,14 @@
if (vtable_map.find (klass) == vtable_map.end ())
{
tree decl = build_decl (VAR_DECL, NULL_TREE, type_dtable);
+ TREE_PUBLIC (decl) = 1;
TREE_STATIC (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
DECL_IGNORED_P (decl) = 1;
mangler m (klass, true);
SET_DECL_ASSEMBLER_NAME (decl,
get_identifier (m.get ().c_str ()));
+ DECL_NAME (decl) = DECL_ASSEMBLER_NAME (decl);
vtable_map[klass] = decl;
}
Index: classobj.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/classobj.cc,v
retrieving revision 1.1.2.14
diff -u -r1.1.2.14 classobj.cc
--- classobj.cc 8 Mar 2005 00:34:36 -0000 1.1.2.14
+++ classobj.cc 8 Mar 2005 00:51:29 -0000
@@ -416,7 +416,6 @@
layout_decl (decl, 0);
rest_of_decl_compilation (decl, 1, 0);
make_decl_rtl (decl);
-
}
void