aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/except.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2003-01-22 20:51:55 +0000
committerTom Tromey <tromey@gcc.gnu.org>2003-01-22 20:51:55 +0000
commit3e895978eef47edaf67b59f02d9f847c55ac26dc (patch)
treeb7d7c4804e0025ba42eee223253a8402fbee444d /gcc/java/except.c
parent7e657a61177515aa1836f3f168c7765096f74610 (diff)
downloadgcc-3e895978eef47edaf67b59f02d9f847c55ac26dc.zip
gcc-3e895978eef47edaf67b59f02d9f847c55ac26dc.tar.gz
gcc-3e895978eef47edaf67b59f02d9f847c55ac26dc.tar.bz2
gcj.texi (Input and output files): Mention non-class entries.
* gcj.texi (Input and output files): Mention non-class entries. * decl.c (java_init_decl_processing): Call init_resource_processing. * java-tree.h (compile_resource_data, write_resource_constructor, compile_resource_file, init_resource_processing): Declare. * config-lang.in (gtfiles): Added resource.c. * Make-lang.in (gt-java-resource.h): New target. (JAVA_OBJS): Added resource.o. (java/resource.o): New target. * resource.c: New file. * class.c (compile_resource_file): Moved to resource.c. (registerResource_libfunc): Likewise. (utf8_decl_list): Mark with GTY; now static. * jcf-parse.c (classify_zip_file): New function. (parse_zip_file_entries): Use it; compile .properties files. (process_zip_dir): Use classify_zip_file and compute_class_name. Don't write class name into zip directory. (java_parse_file): Call write_resource_constructor. (compute_class_name): New function. * jcf-io.c (read_zip_member): Reindented. From-SVN: r61614
Diffstat (limited to 'gcc/java/except.c')
-rw-r--r--gcc/java/except.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/gcc/java/except.c b/gcc/java/except.c
index 9ad41a6..dcfefb7 100644
--- a/gcc/java/except.c
+++ b/gcc/java/except.c
@@ -324,10 +324,35 @@ prepare_eh_table_type (tree type)
else if (is_compiled_class (type))
exp = build_class_ref (type);
else
- exp = fold (build
- (PLUS_EXPR, ptr_type_node,
- build_utf8_ref (DECL_NAME (TYPE_NAME (type))),
- size_one_node));
+ {
+ tree ctype = make_node (RECORD_TYPE);
+ tree field = NULL_TREE;
+ tree cinit, decl;
+ tree utf8_ref = build_utf8_ref (DECL_NAME (TYPE_NAME (type)));
+ char buf[64];
+ sprintf (buf, "%s_ref",
+ IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (utf8_ref, 0))));
+ PUSH_FIELD (ctype, field, "dummy", ptr_type_node);
+ PUSH_FIELD (ctype, field, "utf8", utf8const_ptr_type);
+ FINISH_RECORD (ctype);
+ START_RECORD_CONSTRUCTOR (cinit, ctype);
+ PUSH_FIELD_VALUE (cinit, "dummy", integer_minus_one_node);
+ PUSH_FIELD_VALUE (cinit, "utf8", utf8_ref);
+ FINISH_RECORD_CONSTRUCTOR (cinit);
+ TREE_CONSTANT (cinit) = 1;
+ decl = build_decl (VAR_DECL, get_identifier (buf), utf8const_type);
+ TREE_STATIC (decl) = 1;
+ DECL_ARTIFICIAL (decl) = 1;
+ DECL_IGNORED_P (decl) = 1;
+ TREE_READONLY (decl) = 1;
+ TREE_THIS_VOLATILE (decl) = 0;
+ DECL_INITIAL (decl) = cinit;
+ layout_decl (decl, 0);
+ pushdecl (decl);
+ rest_of_decl_compilation (decl, (char*) 0, global_bindings_p (), 0);
+ make_decl_rtl (decl, (char*) 0);
+ exp = build1 (ADDR_EXPR, utf8const_ptr_type, decl);
+ }
return exp;
}