diff options
author | David Daney <ddaney@avtrex.com> | 2008-01-23 23:00:39 +0000 |
---|---|---|
committer | David Daney <daney@gcc.gnu.org> | 2008-01-23 23:00:39 +0000 |
commit | 3e603aef40cb6ac7e1e900ab8d2d74ce71cb6595 (patch) | |
tree | c5724340e6d582282ffea2d456a266bb7efcdf72 /gcc/java/resource.c | |
parent | 6c660aeb0e8079ee3267af0dc3682ce9cdc91385 (diff) | |
download | gcc-3e603aef40cb6ac7e1e900ab8d2d74ce71cb6595.zip gcc-3e603aef40cb6ac7e1e900ab8d2d74ce71cb6595.tar.gz gcc-3e603aef40cb6ac7e1e900ab8d2d74ce71cb6595.tar.bz2 |
2008-01-23 David Daney <ddaney@avtrex.com>
* class.c (hide) Rename to...
(java_hide_decl) ... this throughout, and make public.
* resource.c (Jr_count): Remove.
(compile_resource_data): Call java_mangle_resource_name to generate
decl name. Make resource decl public and hidden.
* mangle.c (java_mangle_resource_name): New function.
* java-tree.h (java_hide_decl, java_mangle_resource_name): Declare
functions.
From-SVN: r131767
Diffstat (limited to 'gcc/java/resource.c')
-rw-r--r-- | gcc/java/resource.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/gcc/java/resource.c b/gcc/java/resource.c index b5cbd2e..e0a403e 100644 --- a/gcc/java/resource.c +++ b/gcc/java/resource.c @@ -51,14 +51,10 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ /* A list of all the resources files. */ static GTY(()) tree resources = NULL; -/* Count of all the resources compiled in this invocation. */ -static int Jr_count = 0; - void compile_resource_data (const char *name, const char *buffer, int length) { tree rtype, field = NULL_TREE, data_type, rinit, data, decl; - char buf[60]; data_type = build_prim_array_type (unsigned_byte_type_node, strlen (name) + length); @@ -79,11 +75,10 @@ compile_resource_data (const char *name, const char *buffer, int length) TREE_CONSTANT (rinit) = 1; TREE_INVARIANT (rinit) = 1; - /* Generate a unique-enough identifier. */ - sprintf (buf, "_Jr%d", ++Jr_count); - - decl = build_decl (VAR_DECL, get_identifier (buf), rtype); + decl = build_decl (VAR_DECL, java_mangle_resource_name (name), rtype); TREE_STATIC (decl) = 1; + TREE_PUBLIC (decl) = 1; + java_hide_decl (decl); DECL_ARTIFICIAL (decl) = 1; DECL_IGNORED_P (decl) = 1; TREE_READONLY (decl) = 1; |