/* Functions related to building resource files.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007 Free Software Foundation, Inc.
+ 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
/* 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);
PUSH_FIELD_VALUE (rinit, "data", data);
FINISH_RECORD_CONSTRUCTOR (rinit);
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;