summaryrefslogtreecommitdiff
path: root/gcc/java/jcf-parse.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-07 10:31:59 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-07 10:31:59 +0000
commit1daf16ed0885573ec41bb4eb00f25c165ba9cf26 (patch)
tree8abab63378b6af81c6c73b90c8da3e67745ef5d0 /gcc/java/jcf-parse.c
parent2b2b3bd8d96c3193c8d9bc606ee1b5b3c9b47000 (diff)
downloadgcc-1daf16ed0885573ec41bb4eb00f25c165ba9cf26.tar.gz
2008-11-07 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r141668 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@141672 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r--gcc/java/jcf-parse.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 8757c5b7981..42b53c824d7 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -1699,7 +1699,33 @@ java_emit_static_constructor (void)
write_resource_constructor (&body);
if (body)
- cgraph_build_static_cdtor ('I', body, DEFAULT_INIT_PRIORITY);
+ {
+ tree name = get_identifier ("_Jv_global_static_constructor");
+
+ tree decl
+ = build_decl (FUNCTION_DECL, name,
+ build_function_type (void_type_node, void_list_node));
+
+ tree resdecl = build_decl (RESULT_DECL, NULL_TREE, void_type_node);
+ DECL_ARTIFICIAL (resdecl) = 1;
+ DECL_RESULT (decl) = resdecl;
+ current_function_decl = decl;
+ allocate_struct_function (decl, false);
+
+ TREE_STATIC (decl) = 1;
+ TREE_USED (decl) = 1;
+ DECL_ARTIFICIAL (decl) = 1;
+ DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (decl) = 1;
+ DECL_SAVED_TREE (decl) = body;
+ DECL_UNINLINABLE (decl) = 1;
+
+ DECL_INITIAL (decl) = make_node (BLOCK);
+ TREE_USED (DECL_INITIAL (decl)) = 1;
+
+ DECL_STATIC_CONSTRUCTOR (decl) = 1;
+ java_genericize (decl);
+ cgraph_finalize_function (decl, false);
+ }
}