aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/decl.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>2000-05-31 23:55:54 +0000
committerTom Tromey <tromey@cygnus.com>2000-05-31 23:55:54 +0000
commit5c2eae13b31d022d70398fa62c1143fc25a868ba (patch)
tree4f3739aba4cbd6834e7170f2b709c69b16eff980 /gcc/java/decl.c
parent25326633b2c99ee60d4d8eb158bded9a5007c992 (diff)
* java-tree.h (boolean_array_vtable, byte_array_vtable,
char_array_vtable, short_array_vtable, int_array_vtable, long_array_vtable, float_array_vtable, double_array_vtable): Declare. * expr.c (get_primitive_array_vtable): New function. (create_primitive_vtable): New function. (java_lang_expand_expr): Enable code to statically generate arrays. * decl.c (init_decl_processing): Create primitive vtables. (boolean_array_vtable, byte_array_vtable, char_array_vtable, short_array_vtable, int_array_vtable, long_array_vtable, float_array_vtable, double_array_vtable): Define. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@34314 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/decl.c')
-rw-r--r--gcc/java/decl.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index c5008a0adda..7619d636c4a 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -392,6 +392,16 @@ tree soft_irem_node;
tree soft_ldiv_node;
tree soft_lrem_node;
+/* Declarations for vtables for primitive arrays. */
+tree boolean_array_vtable;
+tree byte_array_vtable;
+tree char_array_vtable;
+tree short_array_vtable;
+tree int_array_vtable;
+tree long_array_vtable;
+tree float_array_vtable;
+tree double_array_vtable;
+
/* Build (and pushdecl) a "promoted type" for all standard
types shorter than int. */
@@ -451,6 +461,21 @@ builtin_function (name, type, function_code, class, library_name)
return decl;
}
+/* Return tree that represents a vtable for a primitive array. */
+static tree
+create_primitive_vtable (name)
+ const char *name;
+{
+ tree r;
+ char buf[50];
+
+ sprintf (buf, "_Jv_%sVTable", name);
+ r = build_decl (VAR_DECL, get_identifier (buf), ptr_type_node);
+ DECL_EXTERNAL (r) = 1;
+ make_decl_rtl (r, buf, 1);
+ return r;
+}
+
void
init_decl_processing ()
{
@@ -573,7 +598,17 @@ init_decl_processing ()
float_zero_node = build_real (float_type_node, dconst0);
double_zero_node = build_real (double_type_node, dconst0);
- /* As your adding items here, please update the code right after
+ /* These are the vtables for arrays of primitives. */
+ boolean_array_vtable = create_primitive_vtable ("boolean");
+ byte_array_vtable = create_primitive_vtable ("byte");
+ char_array_vtable = create_primitive_vtable ("char");
+ short_array_vtable = create_primitive_vtable ("short");
+ int_array_vtable = create_primitive_vtable ("int");
+ long_array_vtable = create_primitive_vtable ("long");
+ float_array_vtable = create_primitive_vtable ("float");
+ double_array_vtable = create_primitive_vtable ("double");
+
+ /* As you're adding items here, please update the code right after
this section, so that the filename containing the source code of
the pre-defined class gets registered correctly. */
unqualified_object_id_node = get_identifier ("Object");