* All Files: Convert to ISO C style function definitions.
From-SVN: r61218
This commit is contained in:
parent
8e37cba890
commit
0a2f0c5497
|
@ -1,3 +1,7 @@
|
|||
2003-01-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
|
||||
|
||||
* All Files: Convert to ISO C style function definitions.
|
||||
|
||||
2003-01-09 Nathanael Nerode <neroden@gcc.gnu.org>
|
||||
|
||||
* parse.y (check_pkg_class_access): ANSIfy definition.
|
||||
|
|
|
@ -43,9 +43,8 @@ static void set_bit (unsigned HOST_WIDE_INT *, unsigned HOST_WIDE_INT *,
|
|||
/* Treat two HOST_WIDE_INT's as a contiguous bitmap, with bit 0 being
|
||||
the least significant. This function sets bit N in the bitmap. */
|
||||
static void
|
||||
set_bit (low, high, n)
|
||||
unsigned HOST_WIDE_INT *low, *high;
|
||||
unsigned int n;
|
||||
set_bit (unsigned HOST_WIDE_INT *low, unsigned HOST_WIDE_INT *high,
|
||||
unsigned int n)
|
||||
{
|
||||
HOST_WIDE_INT *which;
|
||||
|
||||
|
@ -62,15 +61,14 @@ set_bit (low, high, n)
|
|||
|
||||
/* Recursively mark reference fields. */
|
||||
static void
|
||||
mark_reference_fields (field, low, high, ubit,
|
||||
pointer_after_end, all_bits_set,
|
||||
last_set_index, last_view_index)
|
||||
tree field;
|
||||
unsigned HOST_WIDE_INT *low, *high;
|
||||
unsigned int ubit;
|
||||
int *pointer_after_end, *all_bits_set;
|
||||
int *last_set_index;
|
||||
HOST_WIDE_INT *last_view_index;
|
||||
mark_reference_fields (tree field,
|
||||
unsigned HOST_WIDE_INT *low,
|
||||
unsigned HOST_WIDE_INT *high,
|
||||
unsigned int ubit,
|
||||
int *pointer_after_end,
|
||||
int *all_bits_set,
|
||||
int *last_set_index,
|
||||
HOST_WIDE_INT *last_view_index)
|
||||
{
|
||||
/* See if we have fields from our superclass. */
|
||||
if (DECL_NAME (field) == NULL_TREE)
|
||||
|
|
|
@ -29,9 +29,7 @@ Boston, MA 02111-1307, USA. */
|
|||
/* Grow BUFP so there is room for at least SIZE more bytes. */
|
||||
|
||||
void
|
||||
buffer_grow (bufp, size)
|
||||
struct buffer *bufp;
|
||||
int size;
|
||||
buffer_grow (struct buffer *bufp, int size)
|
||||
{
|
||||
if (bufp->limit - bufp->ptr >= size)
|
||||
return;
|
||||
|
|
|
@ -116,8 +116,7 @@ static tree builtin_types[(int) BT_LAST];
|
|||
/* Internal functions which implement various builtin conversions. */
|
||||
|
||||
static tree
|
||||
max_builtin (method_return_type, method_arguments)
|
||||
tree method_return_type, method_arguments;
|
||||
max_builtin (tree method_return_type, tree method_arguments)
|
||||
{
|
||||
return build (MAX_EXPR, method_return_type,
|
||||
TREE_VALUE (method_arguments),
|
||||
|
@ -125,8 +124,7 @@ max_builtin (method_return_type, method_arguments)
|
|||
}
|
||||
|
||||
static tree
|
||||
min_builtin (method_return_type, method_arguments)
|
||||
tree method_return_type, method_arguments;
|
||||
min_builtin (tree method_return_type, tree method_arguments)
|
||||
{
|
||||
return build (MIN_EXPR, method_return_type,
|
||||
TREE_VALUE (method_arguments),
|
||||
|
@ -134,8 +132,7 @@ min_builtin (method_return_type, method_arguments)
|
|||
}
|
||||
|
||||
static tree
|
||||
abs_builtin (method_return_type, method_arguments)
|
||||
tree method_return_type, method_arguments;
|
||||
abs_builtin (tree method_return_type, tree method_arguments)
|
||||
{
|
||||
return build1 (ABS_EXPR, method_return_type,
|
||||
TREE_VALUE (method_arguments));
|
||||
|
@ -155,8 +152,7 @@ build_function_call_expr (tree fn, tree arglist)
|
|||
}
|
||||
|
||||
static tree
|
||||
cos_builtin (method_return_type, method_arguments)
|
||||
tree method_return_type ATTRIBUTE_UNUSED, method_arguments;
|
||||
cos_builtin (tree method_return_type ATTRIBUTE_UNUSED, tree method_arguments)
|
||||
{
|
||||
/* FIXME: this assumes that jdouble and double are the same. */
|
||||
tree fn = built_in_decls[BUILT_IN_COS];
|
||||
|
@ -166,8 +162,7 @@ cos_builtin (method_return_type, method_arguments)
|
|||
}
|
||||
|
||||
static tree
|
||||
sin_builtin (method_return_type, method_arguments)
|
||||
tree method_return_type ATTRIBUTE_UNUSED, method_arguments;
|
||||
sin_builtin (tree method_return_type ATTRIBUTE_UNUSED, tree method_arguments)
|
||||
{
|
||||
/* FIXME: this assumes that jdouble and double are the same. */
|
||||
tree fn = built_in_decls[BUILT_IN_SIN];
|
||||
|
@ -177,8 +172,7 @@ sin_builtin (method_return_type, method_arguments)
|
|||
}
|
||||
|
||||
static tree
|
||||
sqrt_builtin (method_return_type, method_arguments)
|
||||
tree method_return_type ATTRIBUTE_UNUSED, method_arguments;
|
||||
sqrt_builtin (tree method_return_type ATTRIBUTE_UNUSED, tree method_arguments)
|
||||
{
|
||||
/* FIXME: this assumes that jdouble and double are the same. */
|
||||
tree fn = built_in_decls[BUILT_IN_SQRT];
|
||||
|
@ -191,12 +185,11 @@ sqrt_builtin (method_return_type, method_arguments)
|
|||
|
||||
/* Define a single builtin. */
|
||||
static void
|
||||
define_builtin (val, name, class, type, fallback_p)
|
||||
enum built_in_function val;
|
||||
const char *name;
|
||||
enum built_in_class class;
|
||||
tree type;
|
||||
int fallback_p;
|
||||
define_builtin (enum built_in_function val,
|
||||
const char *name,
|
||||
enum built_in_class class,
|
||||
tree type,
|
||||
int fallback_p)
|
||||
{
|
||||
tree decl;
|
||||
|
||||
|
@ -220,8 +213,7 @@ define_builtin (val, name, class, type, fallback_p)
|
|||
|
||||
/* Compute the type for a builtin. */
|
||||
static tree
|
||||
define_builtin_type (ret, arg1, arg2, arg3, arg4)
|
||||
int ret, arg1, arg2, arg3, arg4;
|
||||
define_builtin_type (int ret, int arg1, int arg2, int arg3, int arg4)
|
||||
{
|
||||
tree args;
|
||||
|
||||
|
@ -262,7 +254,7 @@ define_builtin_type (ret, arg1, arg2, arg3, arg4)
|
|||
|
||||
/* Initialize the builtins. */
|
||||
void
|
||||
initialize_builtins ()
|
||||
initialize_builtins (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -322,9 +314,7 @@ initialize_builtins ()
|
|||
/* If the call matches a builtin, return the
|
||||
appropriate builtin expression instead. */
|
||||
tree
|
||||
check_for_builtin (method, call)
|
||||
tree method;
|
||||
tree call;
|
||||
check_for_builtin (tree method, tree call)
|
||||
{
|
||||
if (! flag_emit_class_files && optimize && TREE_CODE (call) == CALL_EXPR)
|
||||
{
|
||||
|
|
|
@ -162,8 +162,7 @@ static void check_final_reassigned (tree, words);
|
|||
Return the declaration or NULL_TREE if no interesting declaration. */
|
||||
|
||||
static tree
|
||||
get_variable_decl (exp)
|
||||
tree exp;
|
||||
get_variable_decl (tree exp)
|
||||
{
|
||||
if (TREE_CODE (exp) == VAR_DECL)
|
||||
{
|
||||
|
@ -196,8 +195,7 @@ get_variable_decl (exp)
|
|||
}
|
||||
|
||||
static void
|
||||
final_assign_error (name)
|
||||
tree name;
|
||||
final_assign_error (tree name)
|
||||
{
|
||||
static const char format[]
|
||||
= "can't reassign a value to the final variable '%s'";
|
||||
|
@ -205,9 +203,7 @@ final_assign_error (name)
|
|||
}
|
||||
|
||||
static void
|
||||
check_final_reassigned (decl, before)
|
||||
tree decl;
|
||||
words before;
|
||||
check_final_reassigned (tree decl, words before)
|
||||
{
|
||||
int index = DECL_BIT_INDEX (decl);
|
||||
/* A final local already assigned or a final parameter
|
||||
|
@ -225,10 +221,8 @@ check_final_reassigned (decl, before)
|
|||
BEFORE, WHEN_FALSE, and WHEN_TRUE are as in check_bool_init. */
|
||||
|
||||
static void
|
||||
check_cond_init (test_exp, then_exp, else_exp,
|
||||
before, when_false, when_true)
|
||||
tree test_exp, then_exp, else_exp;
|
||||
words before, when_false, when_true;
|
||||
check_cond_init (tree test_exp, tree then_exp, tree else_exp,
|
||||
words before, words when_false, words when_true)
|
||||
{
|
||||
int save_start_current_locals = start_current_locals;
|
||||
DECLARE_BUFFERS(test_false, 6);
|
||||
|
@ -253,9 +247,8 @@ check_cond_init (test_exp, then_exp, else_exp,
|
|||
BEFORE, WHEN_FALSE, and WHEN_TRUE are as in check_bool_init. */
|
||||
|
||||
static void
|
||||
check_bool2_init (code, exp0, exp1, before, when_false, when_true)
|
||||
enum tree_code code; tree exp0, exp1;
|
||||
words before, when_false, when_true;
|
||||
check_bool2_init (enum tree_code code, tree exp0, tree exp1,
|
||||
words before, words when_false, words when_true)
|
||||
{
|
||||
word buf[2*4];
|
||||
words tmp = num_current_words <= 2 ? buf
|
||||
|
@ -321,9 +314,7 @@ check_bool2_init (code, exp0, exp1, before, when_false, when_true)
|
|||
be used as temporary working areas. */
|
||||
|
||||
static void
|
||||
check_bool_init (exp, before, when_false, when_true)
|
||||
tree exp;
|
||||
words before, when_false, when_true;
|
||||
check_bool_init (tree exp, words before, words when_false, words when_true)
|
||||
{
|
||||
switch (TREE_CODE (exp))
|
||||
{
|
||||
|
@ -455,9 +446,7 @@ struct alternatives * alternatives = NULL;
|
|||
of previous alternative branches. */
|
||||
|
||||
static void
|
||||
done_alternative (after, current)
|
||||
words after;
|
||||
struct alternatives *current;
|
||||
done_alternative (words after, struct alternatives *current)
|
||||
{
|
||||
INTERSECTN (current->combined, current->combined, after,
|
||||
WORDS_NEEDED (2 * current->num_locals));
|
||||
|
@ -479,9 +468,7 @@ done_alternative (after, current)
|
|||
/* Check for (un)initialized local variables in EXP. */
|
||||
|
||||
static void
|
||||
check_init (exp, before)
|
||||
tree exp;
|
||||
words before;
|
||||
check_init (tree exp, words before)
|
||||
{
|
||||
tree tmp;
|
||||
again:
|
||||
|
@ -924,8 +911,7 @@ check_init (exp, before)
|
|||
}
|
||||
|
||||
void
|
||||
check_for_initialization (body, mdecl)
|
||||
tree body, mdecl;
|
||||
check_for_initialization (tree body, tree mdecl)
|
||||
{
|
||||
tree decl;
|
||||
word buf[2];
|
||||
|
|
207
gcc/java/class.c
207
gcc/java/class.c
|
@ -105,9 +105,7 @@ static GTY(()) tree class_roots[5];
|
|||
appropriate node does not exist. */
|
||||
|
||||
static assume_compiled_node *
|
||||
find_assume_compiled_node (node, ident)
|
||||
assume_compiled_node *node;
|
||||
const char *ident;
|
||||
find_assume_compiled_node (assume_compiled_node *node, const char *ident)
|
||||
{
|
||||
while (node)
|
||||
{
|
||||
|
@ -146,9 +144,7 @@ find_assume_compiled_node (node, ident)
|
|||
if EXCLUDEP is nonzero. */
|
||||
|
||||
void
|
||||
add_assume_compiled (ident, excludep)
|
||||
const char *ident;
|
||||
int excludep;
|
||||
add_assume_compiled (const char *ident, int excludep)
|
||||
{
|
||||
int len;
|
||||
assume_compiled_node *parent;
|
||||
|
@ -199,8 +195,7 @@ add_assume_compiled (ident, excludep)
|
|||
should assume has been compiled to object code. */
|
||||
|
||||
static int
|
||||
assume_compiled (ident)
|
||||
const char *ident;
|
||||
assume_compiled (const char *ident)
|
||||
{
|
||||
assume_compiled_node *i;
|
||||
int result;
|
||||
|
@ -221,13 +216,12 @@ assume_compiled (ident)
|
|||
Also, PREFIX is prepended, and SUFFIX is appended. */
|
||||
|
||||
tree
|
||||
ident_subst (old_name, old_length, prefix, old_char, new_char, suffix)
|
||||
const char* old_name;
|
||||
int old_length;
|
||||
const char *prefix;
|
||||
int old_char;
|
||||
int new_char;
|
||||
const char *suffix;
|
||||
ident_subst (const char* old_name,
|
||||
int old_length,
|
||||
const char *prefix,
|
||||
int old_char,
|
||||
int new_char,
|
||||
const char *suffix)
|
||||
{
|
||||
int prefix_len = strlen (prefix);
|
||||
int suffix_len = strlen (suffix);
|
||||
|
@ -254,12 +248,11 @@ ident_subst (old_name, old_length, prefix, old_char, new_char, suffix)
|
|||
Also, PREFIX is prepended, and SUFFIX is appended. */
|
||||
|
||||
tree
|
||||
identifier_subst (old_id, prefix, old_char, new_char, suffix)
|
||||
const tree old_id;
|
||||
const char *prefix;
|
||||
int old_char;
|
||||
int new_char;
|
||||
const char *suffix;
|
||||
identifier_subst (const tree old_id,
|
||||
const char *prefix,
|
||||
int old_char,
|
||||
int new_char,
|
||||
const char *suffix)
|
||||
{
|
||||
return ident_subst (IDENTIFIER_POINTER (old_id), IDENTIFIER_LENGTH (old_id),
|
||||
prefix, old_char, new_char, suffix);
|
||||
|
@ -269,9 +262,7 @@ identifier_subst (old_id, prefix, old_char, new_char, suffix)
|
|||
prefixed by PREFIX. */
|
||||
|
||||
tree
|
||||
mangled_classname (prefix, type)
|
||||
const char *prefix;
|
||||
tree type;
|
||||
mangled_classname (const char *prefix, tree type)
|
||||
{
|
||||
tree ident = TYPE_NAME (type);
|
||||
if (TREE_CODE (ident) != IDENTIFIER_NODE)
|
||||
|
@ -280,7 +271,7 @@ mangled_classname (prefix, type)
|
|||
}
|
||||
|
||||
tree
|
||||
make_class ()
|
||||
make_class (void)
|
||||
{
|
||||
tree type;
|
||||
type = make_node (RECORD_TYPE);
|
||||
|
@ -295,8 +286,7 @@ make_class ()
|
|||
return a corresponding IDENTIFIER_NODE, except using '.' as separator. */
|
||||
|
||||
tree
|
||||
unmangle_classname (name, name_length)
|
||||
const char *name; int name_length;
|
||||
unmangle_classname (const char *name, int name_length)
|
||||
{
|
||||
tree to_return = ident_subst (name, name_length, "", '/', '.', "");
|
||||
/* It's not sufficient to compare to_return and get_identifier
|
||||
|
@ -315,8 +305,7 @@ unmangle_classname (name, name_length)
|
|||
}
|
||||
|
||||
tree
|
||||
push_class (class_type, class_name)
|
||||
tree class_type, class_name;
|
||||
push_class (tree class_type, tree class_name)
|
||||
{
|
||||
tree decl, signature;
|
||||
const char *save_input_filename = input_filename;
|
||||
|
@ -351,8 +340,7 @@ push_class (class_type, class_name)
|
|||
fill in field or methods, or do layout_type. */
|
||||
|
||||
tree
|
||||
lookup_class (name)
|
||||
tree name;
|
||||
lookup_class (tree name)
|
||||
{
|
||||
tree decl = IDENTIFIER_CLASS_VALUE (name);
|
||||
if (decl == NULL_TREE)
|
||||
|
@ -361,11 +349,8 @@ lookup_class (name)
|
|||
}
|
||||
|
||||
void
|
||||
set_super_info (access_flags, this_class, super_class, interfaces_count)
|
||||
int access_flags;
|
||||
tree this_class;
|
||||
tree super_class;
|
||||
int interfaces_count;
|
||||
set_super_info (int access_flags, tree this_class,
|
||||
tree super_class, int interfaces_count)
|
||||
{
|
||||
int total_supers = interfaces_count;
|
||||
tree class_decl = TYPE_NAME (this_class);
|
||||
|
@ -388,9 +373,7 @@ set_super_info (access_flags, this_class, super_class, interfaces_count)
|
|||
}
|
||||
|
||||
void
|
||||
set_class_decl_access_flags (access_flags, class_decl)
|
||||
int access_flags;
|
||||
tree class_decl;
|
||||
set_class_decl_access_flags (int access_flags, tree class_decl)
|
||||
{
|
||||
if (access_flags & ACC_PUBLIC) CLASS_PUBLIC (class_decl) = 1;
|
||||
if (access_flags & ACC_FINAL) CLASS_FINAL (class_decl) = 1;
|
||||
|
@ -407,8 +390,7 @@ set_class_decl_access_flags (access_flags, class_decl)
|
|||
direct sub-classes of Object are 1, and so on. */
|
||||
|
||||
int
|
||||
class_depth (clas)
|
||||
tree clas;
|
||||
class_depth (tree clas)
|
||||
{
|
||||
int depth = 0;
|
||||
if (! CLASS_LOADED_P (clas))
|
||||
|
@ -426,8 +408,7 @@ class_depth (clas)
|
|||
/* Return true iff TYPE2 is an interface that extends interface TYPE1 */
|
||||
|
||||
int
|
||||
interface_of_p (type1, type2)
|
||||
tree type1, type2;
|
||||
interface_of_p (tree type1, tree type2)
|
||||
{
|
||||
int n, i;
|
||||
tree basetype_vec;
|
||||
|
@ -454,8 +435,7 @@ interface_of_p (type1, type2)
|
|||
/* Return true iff TYPE1 inherits from TYPE2. */
|
||||
|
||||
int
|
||||
inherits_from_p (type1, type2)
|
||||
tree type1, type2;
|
||||
inherits_from_p (tree type1, tree type2)
|
||||
{
|
||||
while (type1 != NULL_TREE && TREE_CODE (type1) == RECORD_TYPE)
|
||||
{
|
||||
|
@ -469,8 +449,7 @@ inherits_from_p (type1, type2)
|
|||
/* Return a 1 iff TYPE1 is an enclosing context for TYPE2 */
|
||||
|
||||
int
|
||||
enclosing_context_p (type1, type2)
|
||||
tree type1, type2;
|
||||
enclosing_context_p (tree type1, tree type2)
|
||||
{
|
||||
if (!INNER_CLASS_TYPE_P (type2))
|
||||
return 0;
|
||||
|
@ -490,8 +469,7 @@ enclosing_context_p (type1, type2)
|
|||
/* Return 1 iff there exists a common enclosing context between TYPE1
|
||||
and TYPE2. */
|
||||
|
||||
int common_enclosing_context_p (type1, type2)
|
||||
tree type1, type2;
|
||||
int common_enclosing_context_p (tree type1, tree type2)
|
||||
{
|
||||
if (!PURE_INNER_CLASS_TYPE_P (type1) || !PURE_INNER_CLASS_TYPE_P (type2))
|
||||
return 0;
|
||||
|
@ -512,9 +490,7 @@ int common_enclosing_context_p (type1, type2)
|
|||
}
|
||||
|
||||
static void
|
||||
add_interface_do (basetype_vec, interface_class, i)
|
||||
tree basetype_vec, interface_class;
|
||||
int i;
|
||||
add_interface_do (tree basetype_vec, tree interface_class, int i)
|
||||
{
|
||||
tree interface_binfo = make_tree_vec (6);
|
||||
BINFO_TYPE (interface_binfo) = interface_class;
|
||||
|
@ -530,8 +506,7 @@ add_interface_do (basetype_vec, interface_class, i)
|
|||
if attempt is made to add it twice. */
|
||||
|
||||
tree
|
||||
maybe_add_interface (this_class, interface_class)
|
||||
tree this_class, interface_class;
|
||||
maybe_add_interface (tree this_class, tree interface_class)
|
||||
{
|
||||
tree basetype_vec = TYPE_BINFO_BASETYPES (this_class);
|
||||
int i;
|
||||
|
@ -555,8 +530,7 @@ maybe_add_interface (this_class, interface_class)
|
|||
/* Add the INTERFACE_CLASS as one of the interfaces of THIS_CLASS. */
|
||||
|
||||
void
|
||||
add_interface (this_class, interface_class)
|
||||
tree this_class, interface_class;
|
||||
add_interface (tree this_class, tree interface_class)
|
||||
{
|
||||
tree basetype_vec = TYPE_BINFO_BASETYPES (this_class);
|
||||
int i;
|
||||
|
@ -579,9 +553,7 @@ add_interface (this_class, interface_class)
|
|||
in the list (*LIST) whose DECL_NAME is NAME. */
|
||||
|
||||
static tree *
|
||||
find_named_method (list, name)
|
||||
tree *list;
|
||||
tree name;
|
||||
find_named_method (tree *list, tree name)
|
||||
{
|
||||
while (*list && DECL_NAME (*list) != name)
|
||||
list = &TREE_CHAIN (*list);
|
||||
|
@ -590,10 +562,7 @@ find_named_method (list, name)
|
|||
#endif
|
||||
|
||||
static tree
|
||||
build_java_method_type (fntype, this_class, access_flags)
|
||||
tree fntype;
|
||||
tree this_class;
|
||||
int access_flags;
|
||||
build_java_method_type (tree fntype, tree this_class, int access_flags)
|
||||
{
|
||||
if (access_flags & ACC_STATIC)
|
||||
return fntype;
|
||||
|
@ -601,11 +570,7 @@ build_java_method_type (fntype, this_class, access_flags)
|
|||
}
|
||||
|
||||
tree
|
||||
add_method_1 (this_class, access_flags, name, function_type)
|
||||
tree this_class;
|
||||
int access_flags;
|
||||
tree name;
|
||||
tree function_type;
|
||||
add_method_1 (tree this_class, int access_flags, tree name, tree function_type)
|
||||
{
|
||||
tree method_type, fndecl;
|
||||
|
||||
|
@ -667,11 +632,7 @@ add_method_1 (this_class, access_flags, name, function_type)
|
|||
Its signature (mangled type) is METHOD_SIG (an IDENTIFIER_NODE). */
|
||||
|
||||
tree
|
||||
add_method (this_class, access_flags, name, method_sig)
|
||||
tree this_class;
|
||||
int access_flags;
|
||||
tree name;
|
||||
tree method_sig;
|
||||
add_method (tree this_class, int access_flags, tree name, tree method_sig)
|
||||
{
|
||||
tree function_type, fndecl;
|
||||
const unsigned char *sig
|
||||
|
@ -687,11 +648,7 @@ add_method (this_class, access_flags, name, method_sig)
|
|||
}
|
||||
|
||||
tree
|
||||
add_field (class, name, field_type, flags)
|
||||
tree class;
|
||||
tree name;
|
||||
tree field_type;
|
||||
int flags;
|
||||
add_field (tree class, tree name, tree field_type, int flags)
|
||||
{
|
||||
int is_static = (flags & ACC_STATIC) != 0;
|
||||
tree field;
|
||||
|
@ -723,8 +680,7 @@ add_field (class, name, field_type, flags)
|
|||
/* Associate a constant value CONSTANT with VAR_DECL FIELD. */
|
||||
|
||||
void
|
||||
set_constant_value (field, constant)
|
||||
tree field, constant;
|
||||
set_constant_value (tree field, tree constant)
|
||||
{
|
||||
if (field == NULL_TREE)
|
||||
warning ("misplaced ConstantValue attribute (not in any field)");
|
||||
|
@ -751,9 +707,7 @@ set_constant_value (field, constant)
|
|||
|
||||
#if 0
|
||||
int
|
||||
strLengthUtf8 (str, len)
|
||||
char *str;
|
||||
int len;
|
||||
strLengthUtf8 (char *str, int len)
|
||||
{
|
||||
register unsigned char* ptr = (unsigned char*) str;
|
||||
register unsigned char *limit = ptr + len;
|
||||
|
@ -772,9 +726,7 @@ strLengthUtf8 (str, len)
|
|||
*/
|
||||
|
||||
static int32
|
||||
hashUtf8String (str, len)
|
||||
const char *str;
|
||||
int len;
|
||||
hashUtf8String (const char *str, int len)
|
||||
{
|
||||
register const unsigned char* ptr = (const unsigned char*) str;
|
||||
register const unsigned char *limit = ptr + len;
|
||||
|
@ -794,9 +746,7 @@ hashUtf8String (str, len)
|
|||
compiled Java resource, which is accessed by the runtime using
|
||||
NAME. */
|
||||
void
|
||||
compile_resource_file (name, filename)
|
||||
char *name;
|
||||
const char *filename;
|
||||
compile_resource_file (char *name, const char *filename)
|
||||
{
|
||||
struct stat stat_buf;
|
||||
int fd;
|
||||
|
@ -898,8 +848,7 @@ compile_resource_file (name, filename)
|
|||
tree utf8_decl_list = NULL_TREE;
|
||||
|
||||
tree
|
||||
build_utf8_ref (name)
|
||||
tree name;
|
||||
build_utf8_ref (tree name)
|
||||
{
|
||||
const char * name_ptr = IDENTIFIER_POINTER(name);
|
||||
int name_len = IDENTIFIER_LENGTH(name);
|
||||
|
@ -971,8 +920,7 @@ build_utf8_ref (name)
|
|||
Also handles primitive types and array types. */
|
||||
|
||||
tree
|
||||
build_class_ref (type)
|
||||
tree type;
|
||||
build_class_ref (tree type)
|
||||
{
|
||||
int is_compiled = is_compiled_class (type);
|
||||
if (is_compiled)
|
||||
|
@ -1073,8 +1021,7 @@ build_class_ref (type)
|
|||
}
|
||||
|
||||
tree
|
||||
build_static_field_ref (fdecl)
|
||||
tree fdecl;
|
||||
build_static_field_ref (tree fdecl)
|
||||
{
|
||||
tree fclass = DECL_CONTEXT (fdecl);
|
||||
int is_compiled = is_compiled_class (fclass);
|
||||
|
@ -1124,8 +1071,7 @@ build_static_field_ref (fdecl)
|
|||
}
|
||||
|
||||
int
|
||||
get_access_flags_from_decl (decl)
|
||||
tree decl;
|
||||
get_access_flags_from_decl (tree decl)
|
||||
{
|
||||
int access_flags = 0;
|
||||
if (TREE_CODE (decl) == FIELD_DECL || TREE_CODE (decl) == VAR_DECL)
|
||||
|
@ -1196,8 +1142,7 @@ get_access_flags_from_decl (decl)
|
|||
}
|
||||
|
||||
static tree
|
||||
make_field_value (fdecl)
|
||||
tree fdecl;
|
||||
make_field_value (tree fdecl)
|
||||
{
|
||||
tree finit;
|
||||
int flags;
|
||||
|
@ -1241,8 +1186,7 @@ make_field_value (fdecl)
|
|||
}
|
||||
|
||||
static tree
|
||||
make_method_value (mdecl)
|
||||
tree mdecl;
|
||||
make_method_value (tree mdecl)
|
||||
{
|
||||
static int method_name_count = 0;
|
||||
tree minit;
|
||||
|
@ -1318,8 +1262,7 @@ make_method_value (mdecl)
|
|||
}
|
||||
|
||||
static tree
|
||||
get_dispatch_vector (type)
|
||||
tree type;
|
||||
get_dispatch_vector (tree type)
|
||||
{
|
||||
tree vtable = TYPE_VTABLE (type);
|
||||
if (vtable == NULL)
|
||||
|
@ -1350,8 +1293,7 @@ get_dispatch_vector (type)
|
|||
}
|
||||
|
||||
static tree
|
||||
get_dispatch_table (type, this_class_addr)
|
||||
tree type, this_class_addr;
|
||||
get_dispatch_table (tree type, tree this_class_addr)
|
||||
{
|
||||
int abstract_p = CLASS_ABSTRACT (TYPE_NAME (type));
|
||||
tree vtable = get_dispatch_vector (type);
|
||||
|
@ -1426,8 +1368,7 @@ get_dispatch_table (type, this_class_addr)
|
|||
}
|
||||
|
||||
void
|
||||
make_class_data (type)
|
||||
tree type;
|
||||
make_class_data (tree type)
|
||||
{
|
||||
tree decl, cons, temp;
|
||||
tree field, fields_decl;
|
||||
|
@ -1685,7 +1626,7 @@ make_class_data (type)
|
|||
}
|
||||
|
||||
void
|
||||
finish_class ()
|
||||
finish_class (void)
|
||||
{
|
||||
tree method;
|
||||
tree type_methods = TYPE_METHODS (current_class);
|
||||
|
@ -1729,8 +1670,7 @@ finish_class ()
|
|||
return 0 if we cannot assume that CLASS is compiled.
|
||||
Returns 1 for primitive and 0 for array types. */
|
||||
int
|
||||
is_compiled_class (class)
|
||||
tree class;
|
||||
is_compiled_class (tree class)
|
||||
{
|
||||
int seen_in_zip;
|
||||
if (TREE_CODE (class) == POINTER_TYPE)
|
||||
|
@ -1776,8 +1716,7 @@ is_compiled_class (class)
|
|||
/* Build a VAR_DECL for the dispatch table (vtable) for class TYPE. */
|
||||
|
||||
tree
|
||||
build_dtable_decl (type)
|
||||
tree type;
|
||||
build_dtable_decl (tree type)
|
||||
{
|
||||
tree dtype;
|
||||
|
||||
|
@ -1835,8 +1774,7 @@ build_dtable_decl (type)
|
|||
fields inherited from SUPER_CLASS. */
|
||||
|
||||
void
|
||||
push_super_field (this_class, super_class)
|
||||
tree this_class, super_class;
|
||||
push_super_field (tree this_class, tree super_class)
|
||||
{
|
||||
tree base_decl;
|
||||
/* Don't insert the field if we're just re-laying the class out. */
|
||||
|
@ -1853,9 +1791,7 @@ push_super_field (this_class, super_class)
|
|||
/* Handle the different manners we may have to lay out a super class. */
|
||||
|
||||
static tree
|
||||
maybe_layout_super_class (super_class, this_class)
|
||||
tree super_class;
|
||||
tree this_class;
|
||||
maybe_layout_super_class (tree super_class, tree this_class)
|
||||
{
|
||||
if (TREE_CODE (super_class) == RECORD_TYPE)
|
||||
{
|
||||
|
@ -1886,8 +1822,7 @@ maybe_layout_super_class (super_class, this_class)
|
|||
}
|
||||
|
||||
void
|
||||
layout_class (this_class)
|
||||
tree this_class;
|
||||
layout_class (tree this_class)
|
||||
{
|
||||
tree super_class = CLASSTYPE_SUPER (this_class);
|
||||
tree field;
|
||||
|
@ -1990,8 +1925,7 @@ layout_class (this_class)
|
|||
}
|
||||
|
||||
void
|
||||
layout_class_methods (this_class)
|
||||
tree this_class;
|
||||
layout_class_methods (tree this_class)
|
||||
{
|
||||
tree method_decl, dtable_count;
|
||||
tree super_class;
|
||||
|
@ -2028,8 +1962,8 @@ layout_class_methods (this_class)
|
|||
DTABLE_COUNT. Also mangle the method's name. */
|
||||
|
||||
tree
|
||||
layout_class_method (this_class, super_class, method_decl, dtable_count)
|
||||
tree this_class, super_class, method_decl, dtable_count;
|
||||
layout_class_method (tree this_class, tree super_class,
|
||||
tree method_decl, tree dtable_count)
|
||||
{
|
||||
tree method_name = DECL_NAME (method_decl);
|
||||
|
||||
|
@ -2087,7 +2021,7 @@ layout_class_method (this_class, super_class, method_decl, dtable_count)
|
|||
}
|
||||
|
||||
void
|
||||
register_class ()
|
||||
register_class (void)
|
||||
{
|
||||
/* END does not need to be registered with the garbage collector
|
||||
because it always points into the list given by REGISTERED_CLASS,
|
||||
|
@ -2114,7 +2048,7 @@ register_class ()
|
|||
class in this file. */
|
||||
|
||||
void
|
||||
emit_register_classes ()
|
||||
emit_register_classes (void)
|
||||
{
|
||||
/* ??? This isn't quite the correct test. We also have to know
|
||||
that the target is using gcc's crtbegin/crtend objects rather
|
||||
|
@ -2205,7 +2139,7 @@ build_method_symbols_entry (tree method)
|
|||
/* Emit the offset symbols table for indirect virtual dispatch. */
|
||||
|
||||
void
|
||||
emit_offset_symbol_table ()
|
||||
emit_offset_symbol_table (void)
|
||||
{
|
||||
tree method_list, method, table, list, null_symbol;
|
||||
tree otable_bound, otable_array_type;
|
||||
|
@ -2260,7 +2194,7 @@ emit_offset_symbol_table ()
|
|||
}
|
||||
|
||||
void
|
||||
init_class_processing ()
|
||||
init_class_processing (void)
|
||||
{
|
||||
registerClass_libfunc = gen_rtx_SYMBOL_REF (Pmode, "_Jv_RegisterClass");
|
||||
registerResource_libfunc =
|
||||
|
@ -2278,17 +2212,14 @@ static int java_treetreehash_compare (const void *, const void *);
|
|||
#define JAVA_TREEHASHHASH_H(t) (htab_hash_pointer (t))
|
||||
|
||||
static hashval_t
|
||||
java_treetreehash_hash (k_p)
|
||||
const void *k_p;
|
||||
java_treetreehash_hash (const void *k_p)
|
||||
{
|
||||
struct treetreehash_entry *k = (struct treetreehash_entry *) k_p;
|
||||
return JAVA_TREEHASHHASH_H (k->key);
|
||||
}
|
||||
|
||||
static int
|
||||
java_treetreehash_compare (k1_p, k2_p)
|
||||
const void * k1_p;
|
||||
const void * k2_p;
|
||||
java_treetreehash_compare (const void * k1_p, const void * k2_p)
|
||||
{
|
||||
struct treetreehash_entry * k1 = (struct treetreehash_entry *) k1_p;
|
||||
tree k2 = (tree) k2_p;
|
||||
|
@ -2296,9 +2227,7 @@ java_treetreehash_compare (k1_p, k2_p)
|
|||
}
|
||||
|
||||
tree
|
||||
java_treetreehash_find (ht, t)
|
||||
htab_t ht;
|
||||
tree t;
|
||||
java_treetreehash_find (htab_t ht, tree t)
|
||||
{
|
||||
struct treetreehash_entry *e;
|
||||
hashval_t hv = JAVA_TREEHASHHASH_H (t);
|
||||
|
@ -2310,9 +2239,7 @@ java_treetreehash_find (ht, t)
|
|||
}
|
||||
|
||||
tree *
|
||||
java_treetreehash_new (ht, t)
|
||||
htab_t ht;
|
||||
tree t;
|
||||
java_treetreehash_new (htab_t ht, tree t)
|
||||
{
|
||||
void **e;
|
||||
struct treetreehash_entry *tthe;
|
||||
|
@ -2331,9 +2258,7 @@ java_treetreehash_new (ht, t)
|
|||
}
|
||||
|
||||
htab_t
|
||||
java_treetreehash_create (size, gc)
|
||||
size_t size;
|
||||
int gc;
|
||||
java_treetreehash_create (size_t size, int gc)
|
||||
{
|
||||
if (gc)
|
||||
return htab_create_ggc (size, java_treetreehash_hash,
|
||||
|
|
|
@ -41,11 +41,7 @@ static tree build_constant_data_ref (void);
|
|||
/* Set the INDEX'th constant in CPOOL to have the given TAG and VALUE. */
|
||||
|
||||
static void
|
||||
set_constant_entry (cpool, index, tag, value)
|
||||
CPool *cpool;
|
||||
int index;
|
||||
int tag;
|
||||
jword value;
|
||||
set_constant_entry (CPool *cpool, int index, int tag, jword value)
|
||||
{
|
||||
if (cpool->data == NULL)
|
||||
{
|
||||
|
@ -73,10 +69,7 @@ set_constant_entry (cpool, index, tag, value)
|
|||
/* Find (or create) a constant pool entry matching TAG and VALUE. */
|
||||
|
||||
int
|
||||
find_constant1 (cpool, tag, value)
|
||||
CPool *cpool;
|
||||
int tag;
|
||||
jword value;
|
||||
find_constant1 (CPool *cpool, int tag, jword value)
|
||||
{
|
||||
int i;
|
||||
for (i = cpool->count; --i > 0; )
|
||||
|
@ -92,10 +85,7 @@ find_constant1 (cpool, tag, value)
|
|||
/* Find a double-word constant pool entry matching TAG and WORD1/WORD2. */
|
||||
|
||||
int
|
||||
find_constant2 (cpool, tag, word1, word2)
|
||||
CPool *cpool;
|
||||
int tag;
|
||||
jword word1, word2;
|
||||
find_constant2 (CPool *cpool, int tag, jword word1, jword word2)
|
||||
{
|
||||
int i;
|
||||
for (i = cpool->count - 1; --i > 0; )
|
||||
|
@ -112,10 +102,7 @@ find_constant2 (cpool, tag, word1, word2)
|
|||
}
|
||||
|
||||
static int
|
||||
find_tree_constant (cpool, tag, value)
|
||||
CPool *cpool;
|
||||
int tag;
|
||||
tree value;
|
||||
find_tree_constant (CPool *cpool, int tag, tree value)
|
||||
{
|
||||
int i;
|
||||
for (i = cpool->count; --i > 0; )
|
||||
|
@ -131,9 +118,7 @@ find_tree_constant (cpool, tag, value)
|
|||
|
||||
|
||||
int
|
||||
find_utf8_constant (cpool, name)
|
||||
CPool *cpool;
|
||||
tree name;
|
||||
find_utf8_constant (CPool *cpool, tree name)
|
||||
{
|
||||
if (name == NULL_TREE)
|
||||
return 0;
|
||||
|
@ -141,10 +126,7 @@ find_utf8_constant (cpool, name)
|
|||
}
|
||||
|
||||
static int
|
||||
find_class_or_string_constant (cpool, tag, name)
|
||||
CPool *cpool;
|
||||
int tag;
|
||||
tree name;
|
||||
find_class_or_string_constant (CPool *cpool, int tag, tree name)
|
||||
{
|
||||
jword j = find_utf8_constant (cpool, name);
|
||||
int i;
|
||||
|
@ -159,9 +141,7 @@ find_class_or_string_constant (cpool, tag, name)
|
|||
}
|
||||
|
||||
int
|
||||
find_class_constant (cpool, type)
|
||||
CPool *cpool;
|
||||
tree type;
|
||||
find_class_constant (CPool *cpool, tree type)
|
||||
{
|
||||
return find_class_or_string_constant (cpool, CONSTANT_Class,
|
||||
build_internal_class_name (type));
|
||||
|
@ -170,9 +150,7 @@ find_class_constant (cpool, type)
|
|||
/* Allocate a CONSTANT_string entry given a STRING_CST. */
|
||||
|
||||
int
|
||||
find_string_constant (cpool, string)
|
||||
CPool *cpool;
|
||||
tree string;
|
||||
find_string_constant (CPool *cpool, tree string)
|
||||
{
|
||||
string = get_identifier (TREE_STRING_POINTER (string));
|
||||
return find_class_or_string_constant (cpool, CONSTANT_String, string);
|
||||
|
@ -183,10 +161,7 @@ find_string_constant (cpool, string)
|
|||
Return its index in the constant pool CPOOL. */
|
||||
|
||||
static int
|
||||
find_name_and_type_constant (cpool, name, type)
|
||||
CPool *cpool;
|
||||
tree name;
|
||||
tree type;
|
||||
find_name_and_type_constant (CPool *cpool, tree name, tree type)
|
||||
{
|
||||
int name_index = find_utf8_constant (cpool, name);
|
||||
int type_index = find_utf8_constant (cpool, build_java_signature (type));
|
||||
|
@ -198,9 +173,7 @@ find_name_and_type_constant (cpool, name, type)
|
|||
Return its index in the constant pool CPOOL. */
|
||||
|
||||
int
|
||||
find_fieldref_index (cpool, decl)
|
||||
CPool *cpool;
|
||||
tree decl;
|
||||
find_fieldref_index (CPool *cpool, tree decl)
|
||||
{
|
||||
int class_index = find_class_constant (cpool, DECL_CONTEXT (decl));
|
||||
int name_type_index
|
||||
|
@ -213,18 +186,13 @@ find_fieldref_index (cpool, decl)
|
|||
Return its index in the constant pool CPOOL. */
|
||||
|
||||
int
|
||||
find_methodref_index (cpool, decl)
|
||||
CPool *cpool;
|
||||
tree decl;
|
||||
find_methodref_index (CPool *cpool, tree decl)
|
||||
{
|
||||
return find_methodref_with_class_index (cpool, decl, DECL_CONTEXT (decl));
|
||||
}
|
||||
|
||||
int
|
||||
find_methodref_with_class_index (cpool, decl, mclass)
|
||||
CPool *cpool;
|
||||
tree decl;
|
||||
tree mclass;
|
||||
find_methodref_with_class_index (CPool *cpool, tree decl, tree mclass)
|
||||
{
|
||||
int class_index = find_class_constant (cpool, mclass);
|
||||
tree name = DECL_CONSTRUCTOR_P (decl) ? init_identifier_node
|
||||
|
@ -248,8 +216,7 @@ find_methodref_with_class_index (cpool, decl, mclass)
|
|||
constant pool. Includes the 2-byte constant_pool_count. */
|
||||
|
||||
int
|
||||
count_constant_pool_bytes (cpool)
|
||||
CPool *cpool;
|
||||
count_constant_pool_bytes (CPool *cpool)
|
||||
{
|
||||
int size = 2;
|
||||
int i = 1;
|
||||
|
@ -294,10 +261,7 @@ count_constant_pool_bytes (cpool)
|
|||
The length of BUFFER is LENGTH, which must match the needed length. */
|
||||
|
||||
void
|
||||
write_constant_pool (cpool, buffer, length)
|
||||
CPool *cpool;
|
||||
unsigned char *buffer;
|
||||
int length;
|
||||
write_constant_pool (CPool *cpool, unsigned char *buffer, int length)
|
||||
{
|
||||
unsigned char *ptr = buffer;
|
||||
int i = 1;
|
||||
|
@ -348,8 +312,7 @@ CPool *outgoing_cpool;
|
|||
|
||||
static GTY(()) tree tag_nodes[13];
|
||||
static tree
|
||||
get_tag_node (tag)
|
||||
int tag;
|
||||
get_tag_node (int tag)
|
||||
{
|
||||
/* A Cache for build_int_2 (CONSTANT_XXX, 0). */
|
||||
|
||||
|
@ -365,9 +328,7 @@ get_tag_node (tag)
|
|||
Returns the index of the entry. */
|
||||
|
||||
int
|
||||
alloc_name_constant (tag, name)
|
||||
int tag;
|
||||
tree name;
|
||||
alloc_name_constant (int tag, tree name)
|
||||
{
|
||||
return find_tree_constant (outgoing_cpool, tag, name);
|
||||
}
|
||||
|
@ -375,8 +336,7 @@ alloc_name_constant (tag, name)
|
|||
/* Build an identifier for the internal name of reference type TYPE. */
|
||||
|
||||
tree
|
||||
build_internal_class_name (type)
|
||||
tree type;
|
||||
build_internal_class_name (tree type)
|
||||
{
|
||||
tree name;
|
||||
if (TYPE_ARRAY_P (type))
|
||||
|
@ -394,8 +354,7 @@ build_internal_class_name (type)
|
|||
/* Look for a CONSTANT_Class entry for CLAS, creating a new one if needed. */
|
||||
|
||||
int
|
||||
alloc_class_constant (clas)
|
||||
tree clas;
|
||||
alloc_class_constant (tree clas)
|
||||
{
|
||||
tree class_name = build_internal_class_name (clas);
|
||||
|
||||
|
@ -408,7 +367,7 @@ alloc_class_constant (clas)
|
|||
/* Return a reference to the data array of the current constant pool. */
|
||||
|
||||
static tree
|
||||
build_constant_data_ref ()
|
||||
build_constant_data_ref (void)
|
||||
{
|
||||
tree cpool_data_ref = NULL_TREE;
|
||||
|
||||
|
@ -433,8 +392,7 @@ build_constant_data_ref ()
|
|||
/* Get the pointer value at the INDEX'th element of the constant pool. */
|
||||
|
||||
tree
|
||||
build_ref_from_constant_pool (index)
|
||||
int index;
|
||||
build_ref_from_constant_pool (int index)
|
||||
{
|
||||
tree t = build_constant_data_ref ();
|
||||
index *= int_size_in_bytes (ptr_type_node);
|
||||
|
@ -447,7 +405,7 @@ build_ref_from_constant_pool (index)
|
|||
Should only be called at top-level, since it may emit declarations. */
|
||||
|
||||
tree
|
||||
build_constants_constructor ()
|
||||
build_constants_constructor (void)
|
||||
{
|
||||
tree tags_value, data_value;
|
||||
tree cons;
|
||||
|
|
121
gcc/java/decl.c
121
gcc/java/decl.c
|
@ -93,7 +93,7 @@ int is_class_level = 0;
|
|||
int current_pc;
|
||||
|
||||
void
|
||||
indent ()
|
||||
indent (void)
|
||||
{
|
||||
register unsigned i;
|
||||
|
||||
|
@ -103,9 +103,7 @@ indent ()
|
|||
#endif /* defined(DEBUG_JAVA_BINDING_LEVELS) */
|
||||
|
||||
static tree
|
||||
push_jvm_slot (index, decl)
|
||||
int index;
|
||||
tree decl;
|
||||
push_jvm_slot (int index, tree decl)
|
||||
{
|
||||
struct rtx_def *rtl = NULL;
|
||||
tree type = TREE_TYPE (decl);
|
||||
|
@ -152,11 +150,7 @@ push_jvm_slot (index, decl)
|
|||
is returned, then updated is set to true. */
|
||||
|
||||
static tree
|
||||
check_local_named_variable (best, decl, pc, updated)
|
||||
tree best;
|
||||
tree decl;
|
||||
int pc;
|
||||
int *updated;
|
||||
check_local_named_variable (tree best, tree decl, int pc, int *updated)
|
||||
{
|
||||
if (pc >= DECL_LOCAL_START_PC (decl)
|
||||
&& pc < DECL_LOCAL_END_PC (decl))
|
||||
|
@ -177,10 +171,7 @@ check_local_named_variable (best, decl, pc, updated)
|
|||
than 'best', return 'decl'. Otherwise return 'best'. */
|
||||
|
||||
static tree
|
||||
check_local_unnamed_variable (best, decl, type)
|
||||
tree best;
|
||||
tree decl;
|
||||
tree type;
|
||||
check_local_unnamed_variable (tree best, tree decl, tree type)
|
||||
{
|
||||
if (TREE_TYPE (decl) == type
|
||||
|| (TREE_CODE (TREE_TYPE (decl)) == TREE_CODE (type)
|
||||
|
@ -204,10 +195,7 @@ check_local_unnamed_variable (best, decl, type)
|
|||
If there is no existing matching decl, allocate one. */
|
||||
|
||||
tree
|
||||
find_local_variable (index, type, pc)
|
||||
int index;
|
||||
tree type;
|
||||
int pc;
|
||||
find_local_variable (int index, tree type, int pc)
|
||||
{
|
||||
tree decl = TREE_VEC_ELT (decl_map, index);
|
||||
tree best = NULL_TREE;
|
||||
|
@ -253,9 +241,7 @@ find_local_variable (index, type, pc)
|
|||
/* Same as find_local_index, except that INDEX is a stack index. */
|
||||
|
||||
tree
|
||||
find_stack_slot (index, type)
|
||||
int index;
|
||||
tree type;
|
||||
find_stack_slot (int index, tree type)
|
||||
{
|
||||
return find_local_variable (index + DECL_MAX_LOCALS (current_function_decl),
|
||||
type, -1);
|
||||
|
@ -341,9 +327,7 @@ tree java_global_trees[JTI_MAX];
|
|||
types shorter than int. */
|
||||
|
||||
static tree
|
||||
push_promoted_type (name, actual_type)
|
||||
const char *name;
|
||||
tree actual_type;
|
||||
push_promoted_type (const char *name, tree actual_type)
|
||||
{
|
||||
tree type = make_node (TREE_CODE (actual_type));
|
||||
#if 1
|
||||
|
@ -373,13 +357,12 @@ push_promoted_type (name, actual_type)
|
|||
ATTRS is nonzero, use that for the function's attribute list. */
|
||||
|
||||
tree
|
||||
builtin_function (name, type, function_code, class, library_name, attrs)
|
||||
const char *name;
|
||||
tree type;
|
||||
int function_code;
|
||||
enum built_in_class class;
|
||||
const char *library_name;
|
||||
tree attrs ATTRIBUTE_UNUSED;
|
||||
builtin_function (const char *name,
|
||||
tree type,
|
||||
int function_code,
|
||||
enum built_in_class class,
|
||||
const char *library_name,
|
||||
tree attrs ATTRIBUTE_UNUSED)
|
||||
{
|
||||
tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
|
||||
DECL_EXTERNAL (decl) = 1;
|
||||
|
@ -395,8 +378,7 @@ builtin_function (name, type, function_code, class, library_name, attrs)
|
|||
|
||||
/* Return tree that represents a vtable for a primitive array. */
|
||||
static tree
|
||||
create_primitive_vtable (name)
|
||||
const char *name;
|
||||
create_primitive_vtable (const char *name)
|
||||
{
|
||||
tree r;
|
||||
char buf[50];
|
||||
|
@ -408,7 +390,7 @@ create_primitive_vtable (name)
|
|||
}
|
||||
|
||||
void
|
||||
java_init_decl_processing ()
|
||||
java_init_decl_processing (void)
|
||||
{
|
||||
register tree endlink;
|
||||
tree field = NULL_TREE;
|
||||
|
@ -952,8 +934,7 @@ java_init_decl_processing ()
|
|||
or return 0 if it is undefined. */
|
||||
|
||||
tree
|
||||
lookup_name (name)
|
||||
tree name;
|
||||
lookup_name (tree name)
|
||||
{
|
||||
register tree val;
|
||||
if (current_binding_level != global_binding_level
|
||||
|
@ -968,8 +949,7 @@ lookup_name (name)
|
|||
the previous one if its the parameter level. */
|
||||
|
||||
static tree
|
||||
lookup_name_current_level (name)
|
||||
tree name;
|
||||
lookup_name_current_level (tree name)
|
||||
{
|
||||
register tree t;
|
||||
|
||||
|
@ -989,8 +969,7 @@ lookup_name_current_level (name)
|
|||
/* Use a binding level to record a labeled block declaration */
|
||||
|
||||
void
|
||||
push_labeled_block (lb)
|
||||
tree lb;
|
||||
push_labeled_block (tree lb)
|
||||
{
|
||||
register tree name = DECL_NAME (LABELED_BLOCK_LABEL (lb));
|
||||
register struct binding_level *b = current_binding_level;
|
||||
|
@ -1006,7 +985,7 @@ push_labeled_block (lb)
|
|||
labeled block */
|
||||
|
||||
void
|
||||
pop_labeled_block ()
|
||||
pop_labeled_block (void)
|
||||
{
|
||||
struct binding_level *b = current_binding_level;
|
||||
tree label = b->names;
|
||||
|
@ -1031,8 +1010,7 @@ pop_labeled_block ()
|
|||
to agree with what X says. */
|
||||
|
||||
tree
|
||||
pushdecl (x)
|
||||
tree x;
|
||||
pushdecl (tree x)
|
||||
{
|
||||
register tree t;
|
||||
register tree name = DECL_NAME (x);
|
||||
|
@ -1150,8 +1128,7 @@ pushdecl (x)
|
|||
}
|
||||
|
||||
void
|
||||
pushdecl_force_head (x)
|
||||
tree x;
|
||||
pushdecl_force_head (tree x)
|
||||
{
|
||||
current_binding_level->names = x;
|
||||
}
|
||||
|
@ -1159,8 +1136,7 @@ pushdecl_force_head (x)
|
|||
/* Like pushdecl, only it places X in GLOBAL_BINDING_LEVEL, if appropriate. */
|
||||
|
||||
tree
|
||||
pushdecl_top_level (x)
|
||||
tree x;
|
||||
pushdecl_top_level (tree x)
|
||||
{
|
||||
register tree t;
|
||||
register struct binding_level *b = current_binding_level;
|
||||
|
@ -1174,7 +1150,7 @@ pushdecl_top_level (x)
|
|||
/* Nonzero if we are currently in the global binding level. */
|
||||
|
||||
int
|
||||
global_bindings_p ()
|
||||
global_bindings_p (void)
|
||||
{
|
||||
return current_binding_level == global_binding_level;
|
||||
}
|
||||
|
@ -1185,7 +1161,7 @@ global_bindings_p ()
|
|||
store the result back using `storedecls' or you will lose. */
|
||||
|
||||
tree
|
||||
getdecls ()
|
||||
getdecls (void)
|
||||
{
|
||||
return current_binding_level->names;
|
||||
}
|
||||
|
@ -1193,15 +1169,14 @@ getdecls ()
|
|||
/* Create a new `struct binding_level'. */
|
||||
|
||||
static struct binding_level *
|
||||
make_binding_level ()
|
||||
make_binding_level (void)
|
||||
{
|
||||
/* NOSTRICT */
|
||||
return xmalloc (sizeof (struct binding_level));
|
||||
}
|
||||
|
||||
void
|
||||
pushlevel (unused)
|
||||
int unused ATTRIBUTE_UNUSED;
|
||||
pushlevel (int unused ATTRIBUTE_UNUSED)
|
||||
{
|
||||
register struct binding_level *newlevel = NULL_BINDING_LEVEL;
|
||||
|
||||
|
@ -1257,10 +1232,7 @@ pushlevel (unused)
|
|||
them into the BLOCK. */
|
||||
|
||||
tree
|
||||
poplevel (keep, reverse, functionbody)
|
||||
int keep;
|
||||
int reverse;
|
||||
int functionbody;
|
||||
poplevel (int keep, int reverse, int functionbody)
|
||||
{
|
||||
register tree link;
|
||||
/* The chain of decls was accumulated in reverse order.
|
||||
|
@ -1464,8 +1436,7 @@ poplevel (keep, reverse, functionbody)
|
|||
}
|
||||
|
||||
void
|
||||
maybe_pushlevels (pc)
|
||||
int pc;
|
||||
maybe_pushlevels (int pc)
|
||||
{
|
||||
#if defined(DEBUG_JAVA_BINDING_LEVELS)
|
||||
current_pc = pc;
|
||||
|
@ -1507,8 +1478,7 @@ maybe_pushlevels (pc)
|
|||
}
|
||||
|
||||
void
|
||||
maybe_poplevels (pc)
|
||||
int pc;
|
||||
maybe_poplevels (int pc)
|
||||
{
|
||||
#if defined(DEBUG_JAVA_BINDING_LEVELS)
|
||||
current_pc = pc;
|
||||
|
@ -1529,8 +1499,7 @@ maybe_poplevels (pc)
|
|||
range is forcibly terminated when that exception ends. */
|
||||
|
||||
void
|
||||
force_poplevels (start_pc)
|
||||
int start_pc;
|
||||
force_poplevels (int start_pc)
|
||||
{
|
||||
while (current_binding_level->start_pc > start_pc)
|
||||
{
|
||||
|
@ -1548,8 +1517,7 @@ force_poplevels (start_pc)
|
|||
to handle the BLOCK node inside the BIND_EXPR. */
|
||||
|
||||
void
|
||||
insert_block (block)
|
||||
tree block;
|
||||
insert_block (tree block)
|
||||
{
|
||||
TREE_USED (block) = 1;
|
||||
current_binding_level->blocks
|
||||
|
@ -1560,8 +1528,7 @@ insert_block (block)
|
|||
(the one we are currently in). */
|
||||
|
||||
void
|
||||
set_block (block)
|
||||
register tree block;
|
||||
set_block (tree block)
|
||||
{
|
||||
current_binding_level->this_block = block;
|
||||
current_binding_level->names = chainon (current_binding_level->names,
|
||||
|
@ -1573,8 +1540,7 @@ set_block (block)
|
|||
/* integrate_decl_tree calls this function. */
|
||||
|
||||
void
|
||||
java_dup_lang_specific_decl (node)
|
||||
tree node;
|
||||
java_dup_lang_specific_decl (tree node)
|
||||
{
|
||||
int lang_decl_size;
|
||||
struct lang_decl *x;
|
||||
|
@ -1589,8 +1555,7 @@ java_dup_lang_specific_decl (node)
|
|||
}
|
||||
|
||||
void
|
||||
give_name_to_locals (jcf)
|
||||
JCF *jcf;
|
||||
give_name_to_locals (JCF *jcf)
|
||||
{
|
||||
int i, n = DECL_LOCALVARIABLES_OFFSET (current_function_decl);
|
||||
int code_offset = DECL_CODE_OFFSET (current_function_decl);
|
||||
|
@ -1688,8 +1653,7 @@ give_name_to_locals (jcf)
|
|||
}
|
||||
|
||||
tree
|
||||
build_result_decl (fndecl)
|
||||
tree fndecl;
|
||||
build_result_decl (tree fndecl)
|
||||
{
|
||||
tree restype = TREE_TYPE (TREE_TYPE (fndecl));
|
||||
tree result = DECL_RESULT (fndecl);
|
||||
|
@ -1707,8 +1671,7 @@ build_result_decl (fndecl)
|
|||
}
|
||||
|
||||
void
|
||||
complete_start_java_method (fndecl)
|
||||
tree fndecl;
|
||||
complete_start_java_method (tree fndecl)
|
||||
{
|
||||
if (! flag_emit_class_files)
|
||||
{
|
||||
|
@ -1780,8 +1743,7 @@ complete_start_java_method (fndecl)
|
|||
}
|
||||
|
||||
void
|
||||
start_java_method (fndecl)
|
||||
tree fndecl;
|
||||
start_java_method (tree fndecl)
|
||||
{
|
||||
tree tem, *ptr;
|
||||
int i;
|
||||
|
@ -1840,7 +1802,7 @@ start_java_method (fndecl)
|
|||
}
|
||||
|
||||
void
|
||||
end_java_method ()
|
||||
end_java_method (void)
|
||||
{
|
||||
tree fndecl = current_function_decl;
|
||||
|
||||
|
@ -1865,9 +1827,7 @@ end_java_method ()
|
|||
/* Dump FUNCTION_DECL FN as tree dump PHASE. */
|
||||
|
||||
static void
|
||||
dump_function (phase, fn)
|
||||
enum tree_dump_index phase;
|
||||
tree fn;
|
||||
dump_function (enum tree_dump_index phase, tree fn)
|
||||
{
|
||||
FILE *stream;
|
||||
int flags;
|
||||
|
@ -1880,8 +1840,7 @@ dump_function (phase, fn)
|
|||
}
|
||||
}
|
||||
|
||||
void java_optimize_inline (fndecl)
|
||||
tree fndecl;
|
||||
void java_optimize_inline (tree fndecl)
|
||||
{
|
||||
if (flag_inline_trees)
|
||||
{
|
||||
|
|
|
@ -77,10 +77,7 @@ extern void indent ();
|
|||
previous children have end_pc values that are too low. */
|
||||
|
||||
static struct eh_range *
|
||||
find_handler_in_range (pc, range, child)
|
||||
int pc;
|
||||
struct eh_range *range;
|
||||
register struct eh_range *child;
|
||||
find_handler_in_range (int pc, struct eh_range *range, struct eh_range *child)
|
||||
{
|
||||
for (; child != NULL; child = child->next_sibling)
|
||||
{
|
||||
|
@ -99,8 +96,7 @@ find_handler_in_range (pc, range, child)
|
|||
/* Find the inner-most handler that contains PC. */
|
||||
|
||||
struct eh_range *
|
||||
find_handler (pc)
|
||||
int pc;
|
||||
find_handler (int pc)
|
||||
{
|
||||
struct eh_range *h;
|
||||
if (pc >= cache_range_start)
|
||||
|
@ -125,8 +121,7 @@ find_handler (pc)
|
|||
/* Recursive helper routine for check_nested_ranges. */
|
||||
|
||||
static void
|
||||
link_handler (range, outer)
|
||||
struct eh_range *range, *outer;
|
||||
link_handler (struct eh_range *range, struct eh_range *outer)
|
||||
{
|
||||
struct eh_range **ptr;
|
||||
|
||||
|
@ -208,7 +203,7 @@ link_handler (range, outer)
|
|||
ensure that exception ranges are properly nested. */
|
||||
|
||||
void
|
||||
handle_nested_ranges ()
|
||||
handle_nested_ranges (void)
|
||||
{
|
||||
struct eh_range *ptr, *next;
|
||||
|
||||
|
@ -225,8 +220,7 @@ handle_nested_ranges ()
|
|||
/* Free RANGE as well as its children and siblings. */
|
||||
|
||||
static void
|
||||
free_eh_ranges (range)
|
||||
struct eh_range *range;
|
||||
free_eh_ranges (struct eh_range *range)
|
||||
{
|
||||
while (range)
|
||||
{
|
||||
|
@ -241,7 +235,7 @@ free_eh_ranges (range)
|
|||
/* Called to re-initialize the exception machinery for a new method. */
|
||||
|
||||
void
|
||||
method_init_exceptions ()
|
||||
method_init_exceptions (void)
|
||||
{
|
||||
free_eh_ranges (&whole_range);
|
||||
whole_range.start_pc = 0;
|
||||
|
@ -267,10 +261,7 @@ method_init_exceptions ()
|
|||
what the sorting counteracts. */
|
||||
|
||||
void
|
||||
add_handler (start_pc, end_pc, handler, type)
|
||||
int start_pc, end_pc;
|
||||
tree handler;
|
||||
tree type;
|
||||
add_handler (int start_pc, int end_pc, tree handler, tree type)
|
||||
{
|
||||
struct eh_range *ptr, *prev = NULL, *h;
|
||||
|
||||
|
@ -306,8 +297,7 @@ add_handler (start_pc, end_pc, handler, type)
|
|||
|
||||
/* if there are any handlers for this range, issue start of region */
|
||||
static void
|
||||
expand_start_java_handler (range)
|
||||
struct eh_range *range;
|
||||
expand_start_java_handler (struct eh_range *range)
|
||||
{
|
||||
#if defined(DEBUG_JAVA_BINDING_LEVELS)
|
||||
indent ();
|
||||
|
@ -319,8 +309,7 @@ expand_start_java_handler (range)
|
|||
}
|
||||
|
||||
tree
|
||||
prepare_eh_table_type (type)
|
||||
tree type;
|
||||
prepare_eh_table_type (tree type)
|
||||
{
|
||||
tree exp;
|
||||
|
||||
|
@ -347,8 +336,7 @@ prepare_eh_table_type (type)
|
|||
exception header. */
|
||||
|
||||
tree
|
||||
build_exception_object_ref (type)
|
||||
tree type;
|
||||
build_exception_object_ref (tree type)
|
||||
{
|
||||
tree obj;
|
||||
|
||||
|
@ -365,8 +353,7 @@ build_exception_object_ref (type)
|
|||
/* If there are any handlers for this range, isssue end of range,
|
||||
and then all handler blocks */
|
||||
static void
|
||||
expand_end_java_handler (range)
|
||||
struct eh_range *range;
|
||||
expand_end_java_handler (struct eh_range *range)
|
||||
{
|
||||
tree handler = range->handlers;
|
||||
force_poplevels (range->start_pc);
|
||||
|
@ -398,9 +385,7 @@ expand_end_java_handler (range)
|
|||
/* Recursive helper routine for maybe_start_handlers. */
|
||||
|
||||
static void
|
||||
check_start_handlers (range, pc)
|
||||
struct eh_range *range;
|
||||
int pc;
|
||||
check_start_handlers (struct eh_range *range, int pc)
|
||||
{
|
||||
if (range != NULL_EH_RANGE && range->start_pc == pc)
|
||||
{
|
||||
|
@ -417,9 +402,7 @@ static struct eh_range *current_range;
|
|||
end_pc. */
|
||||
|
||||
void
|
||||
maybe_start_try (start_pc, end_pc)
|
||||
int start_pc;
|
||||
int end_pc;
|
||||
maybe_start_try (int start_pc, int end_pc)
|
||||
{
|
||||
struct eh_range *range;
|
||||
if (! doing_eh (1))
|
||||
|
@ -438,9 +421,7 @@ maybe_start_try (start_pc, end_pc)
|
|||
start_pc. */
|
||||
|
||||
void
|
||||
maybe_end_try (start_pc, end_pc)
|
||||
int start_pc;
|
||||
int end_pc;
|
||||
maybe_end_try (int start_pc, int end_pc)
|
||||
{
|
||||
if (! doing_eh (1))
|
||||
return;
|
||||
|
|
284
gcc/java/expr.c
284
gcc/java/expr.c
|
@ -137,7 +137,7 @@ const unsigned char *linenumber_table;
|
|||
int linenumber_count;
|
||||
|
||||
void
|
||||
init_expr_processing()
|
||||
init_expr_processing (void)
|
||||
{
|
||||
operand_type[21] = operand_type[54] = int_type_node;
|
||||
operand_type[22] = operand_type[55] = long_type_node;
|
||||
|
@ -147,8 +147,7 @@ init_expr_processing()
|
|||
}
|
||||
|
||||
tree
|
||||
java_truthvalue_conversion (expr)
|
||||
tree expr;
|
||||
java_truthvalue_conversion (tree expr)
|
||||
{
|
||||
/* It is simpler and generates better code to have only TRUTH_*_EXPR
|
||||
or comparison expressions as truth values at this level.
|
||||
|
@ -206,7 +205,7 @@ java_truthvalue_conversion (expr)
|
|||
higher (or the same) index, but not lower. */
|
||||
|
||||
static void
|
||||
flush_quick_stack ()
|
||||
flush_quick_stack (void)
|
||||
{
|
||||
int stack_index = stack_pointer;
|
||||
register tree prev, cur, next;
|
||||
|
@ -242,8 +241,7 @@ flush_quick_stack ()
|
|||
Return true on success, 0 on overflow. */
|
||||
|
||||
int
|
||||
push_type_0 (type)
|
||||
tree type;
|
||||
push_type_0 (tree type)
|
||||
{
|
||||
int n_words;
|
||||
type = promote_type (type);
|
||||
|
@ -258,16 +256,14 @@ push_type_0 (type)
|
|||
}
|
||||
|
||||
void
|
||||
push_type (type)
|
||||
tree type;
|
||||
push_type (tree type)
|
||||
{
|
||||
if (! push_type_0 (type))
|
||||
abort ();
|
||||
}
|
||||
|
||||
static void
|
||||
push_value (value)
|
||||
tree value;
|
||||
push_value (tree value)
|
||||
{
|
||||
tree type = TREE_TYPE (value);
|
||||
if (TYPE_PRECISION (type) < 32 && INTEGRAL_TYPE_P (type))
|
||||
|
@ -294,9 +290,7 @@ push_value (value)
|
|||
On an error, *MESSAGEP is set to a freshly malloc'd error message. */
|
||||
|
||||
tree
|
||||
pop_type_0 (type, messagep)
|
||||
tree type;
|
||||
char **messagep;
|
||||
pop_type_0 (tree type, char **messagep)
|
||||
{
|
||||
int n_words;
|
||||
tree t;
|
||||
|
@ -355,8 +349,7 @@ pop_type_0 (type, messagep)
|
|||
convertible to TYPE, otherwise call error. */
|
||||
|
||||
tree
|
||||
pop_type (type)
|
||||
tree type;
|
||||
pop_type (tree type)
|
||||
{
|
||||
char *message = NULL;
|
||||
type = pop_type_0 (type, &message);
|
||||
|
@ -372,8 +365,7 @@ pop_type (type)
|
|||
Handles array types and interfaces. */
|
||||
|
||||
int
|
||||
can_widen_reference_to (source_type, target_type)
|
||||
tree source_type, target_type;
|
||||
can_widen_reference_to (tree source_type, tree target_type)
|
||||
{
|
||||
if (source_type == ptr_type_node || target_type == object_ptr_type_node)
|
||||
return 1;
|
||||
|
@ -449,8 +441,7 @@ can_widen_reference_to (source_type, target_type)
|
|||
}
|
||||
|
||||
static tree
|
||||
pop_value (type)
|
||||
tree type;
|
||||
pop_value (tree type)
|
||||
{
|
||||
type = pop_type (type);
|
||||
if (quick_stack)
|
||||
|
@ -470,8 +461,7 @@ pop_value (type)
|
|||
/* Pop and discrad the top COUNT stack slots. */
|
||||
|
||||
static void
|
||||
java_stack_pop (count)
|
||||
int count;
|
||||
java_stack_pop (int count)
|
||||
{
|
||||
while (count > 0)
|
||||
{
|
||||
|
@ -497,7 +487,7 @@ java_stack_pop (count)
|
|||
/* Implement the 'swap' operator (to swap two top stack slots). */
|
||||
|
||||
static void
|
||||
java_stack_swap ()
|
||||
java_stack_swap (void)
|
||||
{
|
||||
tree type1, type2;
|
||||
rtx temp;
|
||||
|
@ -522,8 +512,7 @@ java_stack_swap ()
|
|||
}
|
||||
|
||||
static void
|
||||
java_stack_dup (size, offset)
|
||||
int size, offset;
|
||||
java_stack_dup (int size, int offset)
|
||||
{
|
||||
int low_index = stack_pointer - size - offset;
|
||||
int dst_index;
|
||||
|
@ -571,8 +560,7 @@ java_stack_dup (size, offset)
|
|||
value stack. */
|
||||
|
||||
static void
|
||||
build_java_athrow (node)
|
||||
tree node;
|
||||
build_java_athrow (tree node)
|
||||
{
|
||||
tree call;
|
||||
|
||||
|
@ -589,8 +577,7 @@ build_java_athrow (node)
|
|||
/* Implementation for jsr/ret */
|
||||
|
||||
static void
|
||||
build_java_jsr (target_pc, return_pc)
|
||||
int target_pc, return_pc;
|
||||
build_java_jsr (int target_pc, int return_pc)
|
||||
{
|
||||
tree where = lookup_label (target_pc);
|
||||
tree ret = lookup_label (return_pc);
|
||||
|
@ -604,8 +591,7 @@ build_java_jsr (target_pc, return_pc)
|
|||
}
|
||||
|
||||
static void
|
||||
build_java_ret (location)
|
||||
tree location;
|
||||
build_java_ret (tree location)
|
||||
{
|
||||
expand_computed_goto (location);
|
||||
}
|
||||
|
@ -613,8 +599,7 @@ build_java_ret (location)
|
|||
/* Implementation of operations on array: new, load, store, length */
|
||||
|
||||
tree
|
||||
decode_newarray_type (atype)
|
||||
int atype;
|
||||
decode_newarray_type (int atype)
|
||||
{
|
||||
switch (atype)
|
||||
{
|
||||
|
@ -633,8 +618,7 @@ decode_newarray_type (atype)
|
|||
/* Map primitive type to the code used by OPCODE_newarray. */
|
||||
|
||||
int
|
||||
encode_newarray_type (type)
|
||||
tree type;
|
||||
encode_newarray_type (tree type)
|
||||
{
|
||||
if (type == boolean_type_node)
|
||||
return 4;
|
||||
|
@ -660,8 +644,7 @@ encode_newarray_type (type)
|
|||
ArrayIndexOfBoundsException exception handler. */
|
||||
|
||||
static tree
|
||||
build_java_throw_out_of_bounds_exception (index)
|
||||
tree index;
|
||||
build_java_throw_out_of_bounds_exception (tree index)
|
||||
{
|
||||
tree node = build (CALL_EXPR, int_type_node,
|
||||
build_address_of (soft_badarrayindex_node),
|
||||
|
@ -674,8 +657,7 @@ build_java_throw_out_of_bounds_exception (index)
|
|||
or value of the array NODE. May be used to implement some bytecodes. */
|
||||
|
||||
tree
|
||||
build_java_array_length_access (node)
|
||||
tree node;
|
||||
build_java_array_length_access (tree node)
|
||||
{
|
||||
tree type = TREE_TYPE (node);
|
||||
tree array_type = TREE_TYPE (type);
|
||||
|
@ -710,9 +692,7 @@ build_java_array_length_access (node)
|
|||
checks if we're not generating code. */
|
||||
|
||||
tree
|
||||
java_check_reference (expr, check)
|
||||
tree expr;
|
||||
int check;
|
||||
java_check_reference (tree expr, int check)
|
||||
{
|
||||
if (!flag_syntax_only && check)
|
||||
{
|
||||
|
@ -733,10 +713,7 @@ java_check_reference (expr, check)
|
|||
/* Reference an object: just like an INDIRECT_REF, but with checking. */
|
||||
|
||||
tree
|
||||
build_java_indirect_ref (type, expr, check)
|
||||
tree type;
|
||||
tree expr;
|
||||
int check;
|
||||
build_java_indirect_ref (tree type, tree expr, int check)
|
||||
{
|
||||
return build1 (INDIRECT_REF, type, java_check_reference (expr, check));
|
||||
}
|
||||
|
@ -747,8 +724,7 @@ build_java_indirect_ref (type, expr, check)
|
|||
At this point, ARRAY should have been verified as an array. */
|
||||
|
||||
tree
|
||||
build_java_arrayaccess (array, type, index)
|
||||
tree array, type, index;
|
||||
build_java_arrayaccess (tree array, tree type, tree index)
|
||||
{
|
||||
tree node, throw = NULL_TREE;
|
||||
tree data_field;
|
||||
|
@ -798,9 +774,7 @@ build_java_arrayaccess (array, type, index)
|
|||
determine that no check is required. */
|
||||
|
||||
tree
|
||||
build_java_arraystore_check (array, object)
|
||||
tree array;
|
||||
tree object;
|
||||
build_java_arraystore_check (tree array, tree object)
|
||||
{
|
||||
tree check, element_type, source;
|
||||
tree array_type_p = TREE_TYPE (array);
|
||||
|
@ -871,9 +845,7 @@ build_java_arraystore_check (array, object)
|
|||
As a side effect, it also makes sure that ARRAY_NODE is an array. */
|
||||
|
||||
static tree
|
||||
build_java_check_indexed_type (array_node, indexed_type)
|
||||
tree array_node;
|
||||
tree indexed_type;
|
||||
build_java_check_indexed_type (tree array_node, tree indexed_type)
|
||||
{
|
||||
tree elt_type;
|
||||
|
||||
|
@ -900,9 +872,7 @@ build_java_check_indexed_type (array_node, indexed_type)
|
|||
of the array to create. */
|
||||
|
||||
tree
|
||||
build_newarray (atype_value, length)
|
||||
int atype_value;
|
||||
tree length;
|
||||
build_newarray (int atype_value, tree length)
|
||||
{
|
||||
tree type_arg;
|
||||
|
||||
|
@ -932,9 +902,7 @@ build_newarray (atype_value, length)
|
|||
of the dimension. */
|
||||
|
||||
tree
|
||||
build_anewarray (class_type, length)
|
||||
tree class_type;
|
||||
tree length;
|
||||
build_anewarray (tree class_type, tree length)
|
||||
{
|
||||
tree type
|
||||
= build_java_array_type (class_type,
|
||||
|
@ -953,9 +921,7 @@ build_anewarray (class_type, length)
|
|||
/* Return a node the evaluates 'new TYPE[LENGTH]'. */
|
||||
|
||||
tree
|
||||
build_new_array (type, length)
|
||||
tree type;
|
||||
tree length;
|
||||
build_new_array (tree type, tree length)
|
||||
{
|
||||
if (JPRIMITIVE_TYPE_P (type))
|
||||
return build_newarray (encode_newarray_type (type), length);
|
||||
|
@ -968,9 +934,7 @@ build_new_array (type, length)
|
|||
dimensions. The argument list is NULL terminated. */
|
||||
|
||||
static void
|
||||
expand_java_multianewarray (class_type, ndim)
|
||||
tree class_type;
|
||||
int ndim;
|
||||
expand_java_multianewarray (tree class_type, int ndim)
|
||||
{
|
||||
int i;
|
||||
tree args = build_tree_list( NULL_TREE, null_pointer_node );
|
||||
|
@ -998,8 +962,7 @@ expand_java_multianewarray (class_type, ndim)
|
|||
type. It is not necessary to generate this code if ARRAY is final. */
|
||||
|
||||
static void
|
||||
expand_java_arraystore (rhs_type_node)
|
||||
tree rhs_type_node;
|
||||
expand_java_arraystore (tree rhs_type_node)
|
||||
{
|
||||
tree rhs_node = pop_value ((INTEGRAL_TYPE_P (rhs_type_node)
|
||||
&& TYPE_PRECISION (rhs_type_node) <= 32) ?
|
||||
|
@ -1034,8 +997,7 @@ expand_java_arraystore (rhs_type_node)
|
|||
*/
|
||||
|
||||
static void
|
||||
expand_java_arrayload (lhs_type_node )
|
||||
tree lhs_type_node;
|
||||
expand_java_arrayload (tree lhs_type_node )
|
||||
{
|
||||
tree load_node;
|
||||
tree index_node = pop_value (int_type_node);
|
||||
|
@ -1067,7 +1029,7 @@ expand_java_arrayload (lhs_type_node )
|
|||
a NULL check on the array object. */
|
||||
|
||||
static void
|
||||
expand_java_array_length ()
|
||||
expand_java_array_length (void)
|
||||
{
|
||||
tree array = pop_value (ptr_type_node);
|
||||
tree length = build_java_array_length_access (array);
|
||||
|
@ -1079,9 +1041,7 @@ expand_java_array_length ()
|
|||
either soft_monitorenter_node or soft_monitorexit_node. */
|
||||
|
||||
static tree
|
||||
build_java_monitor (call, object)
|
||||
tree call;
|
||||
tree object;
|
||||
build_java_monitor (tree call, tree object)
|
||||
{
|
||||
return (build (CALL_EXPR,
|
||||
void_type_node,
|
||||
|
@ -1093,9 +1053,7 @@ build_java_monitor (call, object)
|
|||
/* Emit code for one of the PUSHC instructions. */
|
||||
|
||||
static void
|
||||
expand_java_pushc (ival, type)
|
||||
int ival;
|
||||
tree type;
|
||||
expand_java_pushc (int ival, tree type)
|
||||
{
|
||||
tree value;
|
||||
if (type == ptr_type_node && ival == 0)
|
||||
|
@ -1118,8 +1076,7 @@ expand_java_pushc (ival, type)
|
|||
}
|
||||
|
||||
static void
|
||||
expand_java_return (type)
|
||||
tree type;
|
||||
expand_java_return (tree type)
|
||||
{
|
||||
if (type == void_type_node)
|
||||
expand_null_return ();
|
||||
|
@ -1144,10 +1101,7 @@ expand_java_return (type)
|
|||
}
|
||||
|
||||
static void
|
||||
expand_load_internal (index, type, pc)
|
||||
int index;
|
||||
tree type;
|
||||
int pc;
|
||||
expand_load_internal (int index, tree type, int pc)
|
||||
{
|
||||
tree copy;
|
||||
tree var = find_local_variable (index, type, pc);
|
||||
|
@ -1170,14 +1124,12 @@ expand_load_internal (index, type, pc)
|
|||
}
|
||||
|
||||
tree
|
||||
build_address_of (value)
|
||||
tree value;
|
||||
build_address_of (tree value)
|
||||
{
|
||||
return build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (value)), value);
|
||||
}
|
||||
|
||||
bool class_has_finalize_method (type)
|
||||
tree type;
|
||||
bool class_has_finalize_method (tree type)
|
||||
{
|
||||
tree super = CLASSTYPE_SUPER (type);
|
||||
|
||||
|
@ -1189,8 +1141,7 @@ bool class_has_finalize_method (type)
|
|||
}
|
||||
|
||||
static void
|
||||
expand_java_NEW (type)
|
||||
tree type;
|
||||
expand_java_NEW (tree type)
|
||||
{
|
||||
tree alloc_node;
|
||||
|
||||
|
@ -1211,8 +1162,7 @@ expand_java_NEW (type)
|
|||
object. */
|
||||
|
||||
tree
|
||||
build_get_class (value)
|
||||
tree value;
|
||||
build_get_class (tree value)
|
||||
{
|
||||
tree class_field = lookup_field (&dtable_type, get_identifier ("class"));
|
||||
tree vtable_field = lookup_field (&object_type_node,
|
||||
|
@ -1231,8 +1181,7 @@ build_get_class (value)
|
|||
known. */
|
||||
|
||||
tree
|
||||
build_instanceof (value, type)
|
||||
tree value, type;
|
||||
build_instanceof (tree value, tree type)
|
||||
{
|
||||
tree expr;
|
||||
tree itype = TREE_TYPE (TREE_TYPE (soft_instanceof_node));
|
||||
|
@ -1295,8 +1244,7 @@ build_instanceof (value, type)
|
|||
}
|
||||
|
||||
static void
|
||||
expand_java_INSTANCEOF (type)
|
||||
tree type;
|
||||
expand_java_INSTANCEOF (tree type)
|
||||
{
|
||||
tree value = pop_value (object_ptr_type_node);
|
||||
value = build_instanceof (value, type);
|
||||
|
@ -1304,8 +1252,7 @@ expand_java_INSTANCEOF (type)
|
|||
}
|
||||
|
||||
static void
|
||||
expand_java_CHECKCAST (type)
|
||||
tree type;
|
||||
expand_java_CHECKCAST (tree type)
|
||||
{
|
||||
tree value = pop_value (ptr_type_node);
|
||||
value = build (CALL_EXPR, promote_type (type),
|
||||
|
@ -1317,10 +1264,7 @@ expand_java_CHECKCAST (type)
|
|||
}
|
||||
|
||||
static void
|
||||
expand_iinc (local_var_index, ival, pc)
|
||||
unsigned int local_var_index;
|
||||
int ival;
|
||||
int pc;
|
||||
expand_iinc (unsigned int local_var_index, int ival, int pc)
|
||||
{
|
||||
tree local_var, res;
|
||||
tree constant_value;
|
||||
|
@ -1334,9 +1278,7 @@ expand_iinc (local_var_index, ival, pc)
|
|||
|
||||
|
||||
tree
|
||||
build_java_soft_divmod (op, type, op1, op2)
|
||||
enum tree_code op;
|
||||
tree type, op1, op2;
|
||||
build_java_soft_divmod (enum tree_code op, tree type, tree op1, tree op2)
|
||||
{
|
||||
tree call = NULL;
|
||||
tree arg1 = convert (type, op1);
|
||||
|
@ -1384,9 +1326,7 @@ build_java_soft_divmod (op, type, op1, op2)
|
|||
}
|
||||
|
||||
tree
|
||||
build_java_binop (op, type, arg1, arg2)
|
||||
enum tree_code op;
|
||||
tree type, arg1, arg2;
|
||||
build_java_binop (enum tree_code op, tree type, tree arg1, tree arg2)
|
||||
{
|
||||
tree mask;
|
||||
switch (op)
|
||||
|
@ -1465,8 +1405,7 @@ build_java_binop (op, type, arg1, arg2)
|
|||
}
|
||||
|
||||
static void
|
||||
expand_java_binop (type, op)
|
||||
tree type; enum tree_code op;
|
||||
expand_java_binop (tree type, enum tree_code op)
|
||||
{
|
||||
tree larg, rarg;
|
||||
tree ltype = type;
|
||||
|
@ -1494,9 +1433,7 @@ expand_java_binop (type, op)
|
|||
class containing the field. */
|
||||
|
||||
tree
|
||||
lookup_field (typep, name)
|
||||
tree *typep;
|
||||
tree name;
|
||||
lookup_field (tree *typep, tree name)
|
||||
{
|
||||
if (CLASS_P (*typep) && !CLASS_LOADED_P (*typep))
|
||||
{
|
||||
|
@ -1554,8 +1491,7 @@ lookup_field (typep, name)
|
|||
SELF_VALUE is NULL_TREE if looking for a static field. */
|
||||
|
||||
tree
|
||||
build_field_ref (self_value, self_class, name)
|
||||
tree self_value, self_class, name;
|
||||
build_field_ref (tree self_value, tree self_class, tree name)
|
||||
{
|
||||
tree base_class = self_class;
|
||||
tree field_decl = lookup_field (&base_class, name);
|
||||
|
@ -1585,8 +1521,7 @@ build_field_ref (self_value, self_class, name)
|
|||
}
|
||||
|
||||
tree
|
||||
lookup_label (pc)
|
||||
int pc;
|
||||
lookup_label (int pc)
|
||||
{
|
||||
tree name;
|
||||
char buf[32];
|
||||
|
@ -1608,7 +1543,7 @@ lookup_label (pc)
|
|||
labels, and try-catch-finally blocks label or temporary variables. */
|
||||
|
||||
tree
|
||||
generate_name ()
|
||||
generate_name (void)
|
||||
{
|
||||
static int l_number = 0;
|
||||
char buff [32];
|
||||
|
@ -1618,8 +1553,7 @@ generate_name ()
|
|||
}
|
||||
|
||||
tree
|
||||
create_label_decl (name)
|
||||
tree name;
|
||||
create_label_decl (tree name)
|
||||
{
|
||||
tree decl;
|
||||
decl = build_decl (LABEL_DECL, name,
|
||||
|
@ -1633,8 +1567,7 @@ create_label_decl (name)
|
|||
char *instruction_bits;
|
||||
|
||||
static void
|
||||
note_label (current_pc, target_pc)
|
||||
int current_pc ATTRIBUTE_UNUSED, target_pc;
|
||||
note_label (int current_pc ATTRIBUTE_UNUSED, int target_pc)
|
||||
{
|
||||
lookup_label (target_pc);
|
||||
instruction_bits [target_pc] |= BCODE_JUMP_TARGET;
|
||||
|
@ -1644,10 +1577,8 @@ note_label (current_pc, target_pc)
|
|||
where CONDITION is one of one the compare operators. */
|
||||
|
||||
static void
|
||||
expand_compare (condition, value1, value2, target_pc)
|
||||
enum tree_code condition;
|
||||
tree value1, value2;
|
||||
int target_pc;
|
||||
expand_compare (enum tree_code condition, tree value1, tree value2,
|
||||
int target_pc)
|
||||
{
|
||||
tree target = lookup_label (target_pc);
|
||||
tree cond = fold (build (condition, boolean_type_node, value1, value2));
|
||||
|
@ -1659,10 +1590,7 @@ expand_compare (condition, value1, value2, target_pc)
|
|||
/* Emit code for a TEST-type opcode. */
|
||||
|
||||
static void
|
||||
expand_test (condition, type, target_pc)
|
||||
enum tree_code condition;
|
||||
tree type;
|
||||
int target_pc;
|
||||
expand_test (enum tree_code condition, tree type, int target_pc)
|
||||
{
|
||||
tree value1, value2;
|
||||
flush_quick_stack ();
|
||||
|
@ -1674,10 +1602,7 @@ expand_test (condition, type, target_pc)
|
|||
/* Emit code for a COND-type opcode. */
|
||||
|
||||
static void
|
||||
expand_cond (condition, type, target_pc)
|
||||
enum tree_code condition;
|
||||
tree type;
|
||||
int target_pc;
|
||||
expand_cond (enum tree_code condition, tree type, int target_pc)
|
||||
{
|
||||
tree value1, value2;
|
||||
flush_quick_stack ();
|
||||
|
@ -1689,8 +1614,7 @@ expand_cond (condition, type, target_pc)
|
|||
}
|
||||
|
||||
static void
|
||||
expand_java_goto (target_pc)
|
||||
int target_pc;
|
||||
expand_java_goto (int target_pc)
|
||||
{
|
||||
tree target_label = lookup_label (target_pc);
|
||||
flush_quick_stack ();
|
||||
|
@ -1699,7 +1623,7 @@ expand_java_goto (target_pc)
|
|||
|
||||
#if 0
|
||||
static void
|
||||
expand_java_call (target_pc, return_address)
|
||||
expand_java_call (int target_pc, int return_address)
|
||||
int target_pc, return_address;
|
||||
{
|
||||
tree target_label = lookup_label (target_pc);
|
||||
|
@ -1710,8 +1634,7 @@ expand_java_call (target_pc, return_address)
|
|||
}
|
||||
|
||||
static void
|
||||
expand_java_ret (return_address)
|
||||
tree return_address ATTRIBUTE_UNUSED;
|
||||
expand_java_ret (tree return_address ATTRIBUTE_UNUSED)
|
||||
{
|
||||
warning ("ret instruction not implemented");
|
||||
#if 0
|
||||
|
@ -1723,8 +1646,7 @@ expand_java_ret (return_address)
|
|||
#endif
|
||||
|
||||
static tree
|
||||
pop_arguments (arg_types)
|
||||
tree arg_types;
|
||||
pop_arguments (tree arg_types)
|
||||
{
|
||||
if (arg_types == end_params_node)
|
||||
return NULL_TREE;
|
||||
|
@ -1747,8 +1669,7 @@ pop_arguments (arg_types)
|
|||
(if it is needed) and then calls EXPR. */
|
||||
|
||||
tree
|
||||
build_class_init (clas, expr)
|
||||
tree clas, expr;
|
||||
build_class_init (tree clas, tree expr)
|
||||
{
|
||||
tree init;
|
||||
if (inherits_from_p (current_class, clas))
|
||||
|
@ -1810,10 +1731,9 @@ build_class_init (clas, expr)
|
|||
}
|
||||
|
||||
tree
|
||||
build_known_method_ref (method, method_type, self_type,
|
||||
method_signature, arg_list)
|
||||
tree method, method_type ATTRIBUTE_UNUSED, self_type,
|
||||
method_signature ATTRIBUTE_UNUSED, arg_list ATTRIBUTE_UNUSED;
|
||||
build_known_method_ref (tree method, tree method_type ATTRIBUTE_UNUSED,
|
||||
tree self_type, tree method_signature ATTRIBUTE_UNUSED,
|
||||
tree arg_list ATTRIBUTE_UNUSED)
|
||||
{
|
||||
tree func;
|
||||
if (is_compiled_class (self_type))
|
||||
|
@ -1864,9 +1784,7 @@ build_known_method_ref (method, method_type, self_type,
|
|||
}
|
||||
|
||||
tree
|
||||
invoke_build_dtable (is_invoke_interface, arg_list)
|
||||
int is_invoke_interface;
|
||||
tree arg_list;
|
||||
invoke_build_dtable (int is_invoke_interface, tree arg_list)
|
||||
{
|
||||
tree dtable, objectref;
|
||||
|
||||
|
@ -1894,8 +1812,7 @@ invoke_build_dtable (is_invoke_interface, arg_list)
|
|||
otable_methods. If it has, the existing otable slot will be reused. */
|
||||
|
||||
int
|
||||
get_offset_table_index (method)
|
||||
tree method;
|
||||
get_offset_table_index (tree method)
|
||||
{
|
||||
int i = 1;
|
||||
tree method_list;
|
||||
|
@ -1924,8 +1841,7 @@ get_offset_table_index (method)
|
|||
}
|
||||
|
||||
tree
|
||||
build_invokevirtual (dtable, method)
|
||||
tree dtable, method;
|
||||
build_invokevirtual (tree dtable, tree method)
|
||||
{
|
||||
tree func;
|
||||
tree nativecode_ptr_ptr_type_node
|
||||
|
@ -1971,8 +1887,7 @@ build_invokevirtual (dtable, method)
|
|||
|
||||
static GTY(()) tree class_ident;
|
||||
tree
|
||||
build_invokeinterface (dtable, method)
|
||||
tree dtable, method;
|
||||
build_invokeinterface (tree dtable, tree method)
|
||||
{
|
||||
tree lookup_arg;
|
||||
tree interface;
|
||||
|
@ -2032,10 +1947,7 @@ build_invokeinterface (dtable, method)
|
|||
NARGS is the number of arguments, or -1 if not specified. */
|
||||
|
||||
static void
|
||||
expand_invoke (opcode, method_ref_index, nargs)
|
||||
int opcode;
|
||||
int method_ref_index;
|
||||
int nargs ATTRIBUTE_UNUSED;
|
||||
expand_invoke (int opcode, int method_ref_index, int nargs ATTRIBUTE_UNUSED)
|
||||
{
|
||||
tree method_signature = COMPONENT_REF_SIGNATURE(¤t_jcf->cpool, method_ref_index);
|
||||
tree method_name = COMPONENT_REF_NAME (¤t_jcf->cpool, method_ref_index);
|
||||
|
@ -2163,8 +2075,7 @@ expand_invoke (opcode, method_ref_index, nargs)
|
|||
a JNI function. */
|
||||
|
||||
tree
|
||||
build_jni_stub (method)
|
||||
tree method;
|
||||
build_jni_stub (tree method)
|
||||
{
|
||||
tree jnifunc, call, args, body, lookup_arg, method_sig, arg_types;
|
||||
tree jni_func_type, tem;
|
||||
|
@ -2345,10 +2256,7 @@ build_jni_stub (method)
|
|||
FIELD_REF_INDEX is an index into the constant pool. */
|
||||
|
||||
static void
|
||||
expand_java_field_op (is_static, is_putting, field_ref_index)
|
||||
int is_static;
|
||||
int is_putting;
|
||||
int field_ref_index;
|
||||
expand_java_field_op (int is_static, int is_putting, int field_ref_index)
|
||||
{
|
||||
tree self_type =
|
||||
get_class_constant (current_jcf,
|
||||
|
@ -2420,8 +2328,7 @@ expand_java_field_op (is_static, is_putting, field_ref_index)
|
|||
}
|
||||
|
||||
void
|
||||
load_type_state (label)
|
||||
tree label;
|
||||
load_type_state (tree label)
|
||||
{
|
||||
int i;
|
||||
tree vec = LABEL_TYPE_STATE (label);
|
||||
|
@ -2436,9 +2343,7 @@ load_type_state (label)
|
|||
placed here because it uses things defined locally in parse.y. */
|
||||
|
||||
static tree
|
||||
case_identity (t, v)
|
||||
tree t __attribute__ ((__unused__));
|
||||
tree v;
|
||||
case_identity (tree t __attribute__ ((__unused__)), tree v)
|
||||
{
|
||||
return v;
|
||||
}
|
||||
|
@ -2471,11 +2376,8 @@ get_primitive_array_vtable (tree elt)
|
|||
}
|
||||
|
||||
struct rtx_def *
|
||||
java_expand_expr (exp, target, tmode, modifier)
|
||||
register tree exp;
|
||||
rtx target;
|
||||
enum machine_mode tmode;
|
||||
int modifier; /* Actually an enum expand_modifier. */
|
||||
java_expand_expr (tree exp, rtx target, enum machine_mode tmode,
|
||||
int modifier /* Actually an enum expand_modifier. */)
|
||||
{
|
||||
tree current;
|
||||
|
||||
|
@ -2665,9 +2567,7 @@ java_expand_expr (exp, target, tmode, modifier)
|
|||
instruction_bits[]. */
|
||||
|
||||
void
|
||||
note_instructions (jcf, method)
|
||||
JCF *jcf;
|
||||
tree method;
|
||||
note_instructions (JCF *jcf, tree method)
|
||||
{
|
||||
int PC;
|
||||
unsigned char* byte_ops;
|
||||
|
@ -2810,9 +2710,7 @@ note_instructions (jcf, method)
|
|||
}
|
||||
|
||||
void
|
||||
expand_byte_code (jcf, method)
|
||||
JCF *jcf;
|
||||
tree method;
|
||||
expand_byte_code (JCF *jcf, tree method)
|
||||
{
|
||||
int PC;
|
||||
int i;
|
||||
|
@ -2921,9 +2819,7 @@ expand_byte_code (jcf, method)
|
|||
}
|
||||
|
||||
static void
|
||||
java_push_constant_from_pool (jcf, index)
|
||||
JCF *jcf;
|
||||
int index;
|
||||
java_push_constant_from_pool (JCF *jcf, int index)
|
||||
{
|
||||
tree c;
|
||||
if (JPOOL_TAG (jcf, index) == CONSTANT_String)
|
||||
|
@ -2940,10 +2836,8 @@ java_push_constant_from_pool (jcf, index)
|
|||
}
|
||||
|
||||
int
|
||||
process_jvm_instruction (PC, byte_ops, length)
|
||||
int PC;
|
||||
const unsigned char* byte_ops;
|
||||
long length ATTRIBUTE_UNUSED;
|
||||
process_jvm_instruction (int PC, const unsigned char* byte_ops,
|
||||
long length ATTRIBUTE_UNUSED)
|
||||
{
|
||||
const char *opname; /* Temporary ??? */
|
||||
int oldpc = PC; /* PC at instruction start. */
|
||||
|
@ -3255,9 +3149,7 @@ process_jvm_instruction (PC, byte_ops, length)
|
|||
CODE_OFFSET. */
|
||||
|
||||
static unsigned char
|
||||
peek_opcode_at_pc (jcf, code_offset, pc)
|
||||
JCF *jcf;
|
||||
int code_offset, pc;
|
||||
peek_opcode_at_pc (JCF *jcf, int code_offset, int pc)
|
||||
{
|
||||
unsigned char opcode;
|
||||
long absolute_offset = (long)JCF_TELL (jcf);
|
||||
|
@ -3293,9 +3185,8 @@ peek_opcode_at_pc (jcf, code_offset, pc)
|
|||
have allocated and filled properly. */
|
||||
|
||||
int
|
||||
maybe_adjust_start_pc (jcf, code_offset, start_pc, slot)
|
||||
struct JCF *jcf;
|
||||
int code_offset, start_pc, slot;
|
||||
maybe_adjust_start_pc (struct JCF *jcf, int code_offset,
|
||||
int start_pc, int slot)
|
||||
{
|
||||
int first, index, opcode;
|
||||
int pc, insn_pc;
|
||||
|
@ -3398,8 +3289,7 @@ maybe_adjust_start_pc (jcf, code_offset, start_pc, slot)
|
|||
*/
|
||||
|
||||
tree
|
||||
force_evaluation_order (node)
|
||||
tree node;
|
||||
force_evaluation_order (tree node)
|
||||
{
|
||||
if (flag_syntax_only)
|
||||
return node;
|
||||
|
@ -3458,9 +3348,7 @@ force_evaluation_order (node)
|
|||
method in order to emit initialization code for each test flag. */
|
||||
|
||||
static int
|
||||
emit_init_test_initialization (entry, x)
|
||||
void * * entry;
|
||||
void * x ATTRIBUTE_UNUSED;
|
||||
emit_init_test_initialization (void **entry, void *x ATTRIBUTE_UNUSED)
|
||||
{
|
||||
struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry;
|
||||
tree klass = build_class_ref (ite->key);
|
||||
|
|
|
@ -254,8 +254,7 @@ static int decompiled = 0;
|
|||
|
||||
/* Return 1 if F is not Inf or NaN. */
|
||||
static int
|
||||
java_float_finite (f)
|
||||
jfloat f;
|
||||
java_float_finite (jfloat f)
|
||||
{
|
||||
union Word u;
|
||||
u.f = f;
|
||||
|
@ -268,8 +267,7 @@ java_float_finite (f)
|
|||
|
||||
/* Return 1 if D is not Inf or NaN. */
|
||||
static int
|
||||
java_double_finite (d)
|
||||
jdouble d;
|
||||
java_double_finite (jdouble d)
|
||||
{
|
||||
union DWord u;
|
||||
u.d = d;
|
||||
|
@ -281,9 +279,7 @@ java_double_finite (d)
|
|||
/* Print a character, appropriately mangled for JNI. */
|
||||
|
||||
static void
|
||||
jni_print_char (stream, ch)
|
||||
FILE *stream;
|
||||
int ch;
|
||||
jni_print_char (FILE *stream, int ch)
|
||||
{
|
||||
if (! flag_jni)
|
||||
jcf_print_char (stream, ch);
|
||||
|
@ -345,10 +341,7 @@ print_name (FILE* stream, JCF* jcf, int name_index)
|
|||
final separator. */
|
||||
|
||||
static void
|
||||
print_base_classname (stream, jcf, index)
|
||||
FILE *stream;
|
||||
JCF *jcf;
|
||||
int index;
|
||||
print_base_classname (FILE *stream, JCF *jcf, int index)
|
||||
{
|
||||
int name_index = JPOOL_USHORT1 (jcf, index);
|
||||
int len;
|
||||
|
@ -379,10 +372,7 @@ print_base_classname (stream, jcf, index)
|
|||
and 1 if STR is "greater" than NAME. */
|
||||
|
||||
static int
|
||||
utf8_cmp (str, length, name)
|
||||
const unsigned char *str;
|
||||
int length;
|
||||
const char *name;
|
||||
utf8_cmp (const unsigned char *str, int length, const char *name)
|
||||
{
|
||||
const unsigned char *limit = str + length;
|
||||
int i;
|
||||
|
@ -513,9 +503,7 @@ static const char *const cxx_keywords[] =
|
|||
Otherwise, return NULL. The return value is malloc()d. */
|
||||
|
||||
static char *
|
||||
cxx_keyword_subst (str, length)
|
||||
const unsigned char *str;
|
||||
int length;
|
||||
cxx_keyword_subst (const unsigned char *str, int length)
|
||||
{
|
||||
int last = ARRAY_SIZE (cxx_keywords);
|
||||
int first = 0;
|
||||
|
@ -562,9 +550,7 @@ cxx_keyword_subst (str, length)
|
|||
/* Generate an access control keyword based on FLAGS. */
|
||||
|
||||
static void
|
||||
generate_access (stream, flags)
|
||||
FILE *stream;
|
||||
JCF_u2 flags;
|
||||
generate_access (FILE *stream, JCF_u2 flags)
|
||||
{
|
||||
if ((flags & ACC_VISIBILITY) == last_access)
|
||||
return;
|
||||
|
@ -594,9 +580,7 @@ generate_access (stream, flags)
|
|||
|
||||
/* See if NAME is already the name of a method. */
|
||||
static int
|
||||
name_is_method_p (name, length)
|
||||
const unsigned char *name;
|
||||
int length;
|
||||
name_is_method_p (const unsigned char *name, int length)
|
||||
{
|
||||
struct method_name *p;
|
||||
|
||||
|
@ -611,11 +595,8 @@ name_is_method_p (name, length)
|
|||
/* If there is already a method named NAME, whose signature is not
|
||||
SIGNATURE, then return true. Otherwise return false. */
|
||||
static int
|
||||
overloaded_jni_method_exists_p (name, length, signature, sig_length)
|
||||
const unsigned char *name;
|
||||
int length;
|
||||
const char *signature;
|
||||
int sig_length;
|
||||
overloaded_jni_method_exists_p (const unsigned char *name, int length,
|
||||
const char *signature, int sig_length)
|
||||
{
|
||||
struct method_name *p;
|
||||
|
||||
|
@ -632,10 +613,7 @@ overloaded_jni_method_exists_p (name, length, signature, sig_length)
|
|||
|
||||
/* Get name of a field. This handles renamings due to C++ clash. */
|
||||
static char *
|
||||
get_field_name (jcf, name_index, flags)
|
||||
JCF *jcf;
|
||||
int name_index;
|
||||
JCF_u2 flags;
|
||||
get_field_name (JCF *jcf, int name_index, JCF_u2 flags)
|
||||
{
|
||||
unsigned char *name = JPOOL_UTF_DATA (jcf, name_index);
|
||||
int length = JPOOL_UTF_LENGTH (jcf, name_index);
|
||||
|
@ -667,11 +645,7 @@ get_field_name (jcf, name_index, flags)
|
|||
/* Print a field name. Convenience function for use with
|
||||
get_field_name. */
|
||||
static void
|
||||
print_field_name (stream, jcf, name_index, flags)
|
||||
FILE *stream;
|
||||
JCF *jcf;
|
||||
int name_index;
|
||||
JCF_u2 flags;
|
||||
print_field_name (FILE *stream, JCF *jcf, int name_index, JCF_u2 flags)
|
||||
{
|
||||
char *override = get_field_name (jcf, name_index, flags);
|
||||
|
||||
|
@ -905,10 +879,8 @@ print_method_info (FILE *stream, JCF* jcf, int name_index, int sig_index,
|
|||
signature. NAMEINDEX is the index of the field name; -1 for
|
||||
`this'. OBJECTTYPE is the index of the object's type. */
|
||||
static void
|
||||
decompile_return_statement (out, jcf, methodtype, nameindex, objecttype)
|
||||
FILE *out;
|
||||
JCF *jcf;
|
||||
int methodtype, nameindex, objecttype;
|
||||
decompile_return_statement (FILE *out, JCF *jcf, int methodtype,
|
||||
int nameindex, int objecttype)
|
||||
{
|
||||
int cast = 0;
|
||||
int obj_name_len, method_name_len;
|
||||
|
@ -1027,10 +999,7 @@ decompile_return_statement (out, jcf, methodtype, nameindex, objecttype)
|
|||
/* Try to decompile a method body. Right now we just try to handle a
|
||||
simple case that we can do. Expand as desired. */
|
||||
static void
|
||||
decompile_method (out, jcf, code_len)
|
||||
FILE *out;
|
||||
JCF *jcf;
|
||||
int code_len;
|
||||
decompile_method (FILE *out, JCF *jcf, int code_len)
|
||||
{
|
||||
const unsigned char *codes = jcf->read_ptr;
|
||||
int index;
|
||||
|
@ -1099,8 +1068,7 @@ decompile_method (out, jcf, code_len)
|
|||
should probably be in hashtab.c to complement the existing string
|
||||
hash function. */
|
||||
static int
|
||||
gcjh_streq (p1, p2)
|
||||
const void *p1, *p2;
|
||||
gcjh_streq (const void *p1, const void *p2)
|
||||
{
|
||||
return ! strcmp ((char *) p1, (char *) p2);
|
||||
}
|
||||
|
@ -1109,8 +1077,7 @@ gcjh_streq (p1, p2)
|
|||
or 0 if not. CLNAME may be extracted from a signature, and can be
|
||||
terminated with either `;' or NULL. */
|
||||
static int
|
||||
throwable_p (clname)
|
||||
const unsigned char *clname;
|
||||
throwable_p (const unsigned char *clname)
|
||||
{
|
||||
int length;
|
||||
unsigned char *current;
|
||||
|
@ -1209,10 +1176,8 @@ throwable_p (clname)
|
|||
/* Print one piece of a signature. Returns pointer to next parseable
|
||||
character on success, NULL on error. */
|
||||
static const unsigned char *
|
||||
decode_signature_piece (stream, signature, limit, need_space)
|
||||
FILE *stream;
|
||||
const unsigned char *signature, *limit;
|
||||
int *need_space;
|
||||
decode_signature_piece (FILE *stream, const unsigned char *signature,
|
||||
const unsigned char *limit, int *need_space)
|
||||
{
|
||||
const char *ctype;
|
||||
int array_depth = 0;
|
||||
|
@ -1630,12 +1595,8 @@ print_mangled_classname (FILE *stream, JCF *jcf, const char *prefix, int index)
|
|||
to an array, ignore it and don't print PREFIX. Returns 1 if
|
||||
something was printed, 0 otherwise. */
|
||||
static int
|
||||
print_cxx_classname (stream, prefix, jcf, index, add_scope)
|
||||
FILE *stream;
|
||||
const char *prefix;
|
||||
JCF *jcf;
|
||||
int index;
|
||||
int add_scope;
|
||||
print_cxx_classname (FILE *stream, const char *prefix,
|
||||
JCF *jcf, int index, int add_scope)
|
||||
{
|
||||
int name_index = JPOOL_USHORT1 (jcf, index);
|
||||
int len, c;
|
||||
|
@ -1674,9 +1635,7 @@ int written_class_count = 0;
|
|||
/* Return name of superclass. If LEN is not NULL, fill it with length
|
||||
of name. */
|
||||
static const unsigned char *
|
||||
super_class_name (derived_jcf, len)
|
||||
JCF *derived_jcf;
|
||||
int *len;
|
||||
super_class_name (JCF *derived_jcf, int *len)
|
||||
{
|
||||
int supername_index = JPOOL_USHORT1 (derived_jcf, derived_jcf->super_class);
|
||||
int supername_length = JPOOL_UTF_LENGTH (derived_jcf, supername_index);
|
||||
|
@ -1704,10 +1663,7 @@ static struct include *all_includes = NULL;
|
|||
|
||||
/* Generate a #include. */
|
||||
static void
|
||||
print_include (out, utf8, len)
|
||||
FILE *out;
|
||||
const unsigned char *utf8;
|
||||
int len;
|
||||
print_include (FILE *out, const unsigned char *utf8, int len)
|
||||
{
|
||||
struct include *incl;
|
||||
|
||||
|
@ -1771,9 +1727,8 @@ static struct namelet root =
|
|||
package or class name and links it into the tree. It does this
|
||||
recursively. */
|
||||
static void
|
||||
add_namelet (name, name_limit, parent)
|
||||
const unsigned char *name, *name_limit;
|
||||
struct namelet *parent;
|
||||
add_namelet (const unsigned char *name, const unsigned char *name_limit,
|
||||
struct namelet *parent)
|
||||
{
|
||||
const unsigned char *p;
|
||||
struct namelet *n = NULL, *np;
|
||||
|
@ -1830,10 +1785,7 @@ add_namelet (name, name_limit, parent)
|
|||
|
||||
/* Print a single namelet. Destroys namelets while printing. */
|
||||
static void
|
||||
print_namelet (out, name, depth)
|
||||
FILE *out;
|
||||
struct namelet *name;
|
||||
int depth;
|
||||
print_namelet (FILE *out, struct namelet *name, int depth)
|
||||
{
|
||||
int i, term = 0;
|
||||
struct namelet *c;
|
||||
|
@ -1886,10 +1838,7 @@ print_namelet (out, name, depth)
|
|||
we need decls. The signature argument can be a function
|
||||
signature. */
|
||||
static void
|
||||
add_class_decl (out, jcf, signature)
|
||||
FILE *out;
|
||||
JCF *jcf;
|
||||
JCF_u2 signature;
|
||||
add_class_decl (FILE *out, JCF *jcf, JCF_u2 signature)
|
||||
{
|
||||
const unsigned char *s = JPOOL_UTF_DATA (jcf, signature);
|
||||
int len = JPOOL_UTF_LENGTH (jcf, signature);
|
||||
|
@ -1923,10 +1872,7 @@ add_class_decl (out, jcf, signature)
|
|||
statically in libjava; we don't generate declarations for these.
|
||||
This makes the generated headers a bit easier to read. */
|
||||
static void
|
||||
print_class_decls (out, jcf, self)
|
||||
FILE *out;
|
||||
JCF *jcf;
|
||||
int self;
|
||||
print_class_decls (FILE *out, JCF *jcf, int self)
|
||||
{
|
||||
/* Make sure to always add the current class to the list of things
|
||||
that should be declared. */
|
||||
|
@ -2244,14 +2190,14 @@ static const struct option options[] =
|
|||
};
|
||||
|
||||
static void
|
||||
usage ()
|
||||
usage (void)
|
||||
{
|
||||
fprintf (stderr, "Try `gcjh --help' for more information.\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
static void
|
||||
help ()
|
||||
help (void)
|
||||
{
|
||||
printf ("Usage: gcjh [OPTION]... CLASS...\n\n");
|
||||
printf ("Generate C++ header files from .class files\n\n");
|
||||
|
@ -2289,7 +2235,7 @@ help ()
|
|||
}
|
||||
|
||||
static void
|
||||
version ()
|
||||
version (void)
|
||||
{
|
||||
printf ("gcjh (GCC) %s\n\n", version_string);
|
||||
printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n");
|
||||
|
|
|
@ -56,7 +56,7 @@ static int print_dummies;
|
|||
invocation. FIXME: we should change our API or just completely use
|
||||
the one in mkdeps.h. */
|
||||
void
|
||||
jcf_dependency_reset ()
|
||||
jcf_dependency_reset (void)
|
||||
{
|
||||
if (dep_out != NULL)
|
||||
{
|
||||
|
@ -73,8 +73,7 @@ jcf_dependency_reset ()
|
|||
}
|
||||
|
||||
void
|
||||
jcf_dependency_set_target (name)
|
||||
const char *name;
|
||||
jcf_dependency_set_target (const char *name)
|
||||
{
|
||||
/* We just handle this the same as an `add_target'. */
|
||||
if (dependencies != NULL && name != NULL)
|
||||
|
@ -82,16 +81,14 @@ jcf_dependency_set_target (name)
|
|||
}
|
||||
|
||||
void
|
||||
jcf_dependency_add_target (name)
|
||||
const char *name;
|
||||
jcf_dependency_add_target (const char *name)
|
||||
{
|
||||
if (dependencies != NULL)
|
||||
deps_add_target (dependencies, name, 1);
|
||||
}
|
||||
|
||||
void
|
||||
jcf_dependency_set_dep_file (name)
|
||||
const char *name;
|
||||
jcf_dependency_set_dep_file (const char *name)
|
||||
{
|
||||
assert (dep_out != stdout);
|
||||
if (dep_out)
|
||||
|
@ -103,9 +100,7 @@ jcf_dependency_set_dep_file (name)
|
|||
}
|
||||
|
||||
void
|
||||
jcf_dependency_add_file (filename, system_p)
|
||||
const char *filename;
|
||||
int system_p;
|
||||
jcf_dependency_add_file (const char *filename, int system_p)
|
||||
{
|
||||
if (! dependencies)
|
||||
return;
|
||||
|
@ -118,8 +113,7 @@ jcf_dependency_add_file (filename, system_p)
|
|||
}
|
||||
|
||||
void
|
||||
jcf_dependency_init (system_p)
|
||||
int system_p;
|
||||
jcf_dependency_init (int system_p)
|
||||
{
|
||||
assert (! dependencies);
|
||||
system_files = system_p;
|
||||
|
@ -127,13 +121,13 @@ jcf_dependency_init (system_p)
|
|||
}
|
||||
|
||||
void
|
||||
jcf_dependency_print_dummies ()
|
||||
jcf_dependency_print_dummies (void)
|
||||
{
|
||||
print_dummies = 1;
|
||||
}
|
||||
|
||||
void
|
||||
jcf_dependency_write ()
|
||||
jcf_dependency_write (void)
|
||||
{
|
||||
if (! dep_out)
|
||||
return;
|
||||
|
|
|
@ -800,14 +800,14 @@ static const struct option options[] =
|
|||
};
|
||||
|
||||
static void
|
||||
usage ()
|
||||
usage (void)
|
||||
{
|
||||
fprintf (stderr, "Try `jcf-dump --help' for more information.\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
static void
|
||||
help ()
|
||||
help (void)
|
||||
{
|
||||
printf ("Usage: jcf-dump [OPTION]... CLASS...\n\n");
|
||||
printf ("Display contents of a class file in readable form.\n\n");
|
||||
|
@ -830,7 +830,7 @@ help ()
|
|||
}
|
||||
|
||||
static void
|
||||
version ()
|
||||
version (void)
|
||||
{
|
||||
printf ("jcf-dump (GCC) %s\n\n", version_string);
|
||||
printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n");
|
||||
|
|
|
@ -106,9 +106,7 @@ static void load_inner_classes (tree);
|
|||
/* Handle "SourceFile" attribute. */
|
||||
|
||||
static void
|
||||
set_source_filename (jcf, index)
|
||||
JCF *jcf;
|
||||
int index;
|
||||
set_source_filename (JCF *jcf, int index)
|
||||
{
|
||||
tree sfname_id = get_name_constant (jcf, index);
|
||||
const char *sfname = IDENTIFIER_POINTER (sfname_id);
|
||||
|
@ -223,9 +221,7 @@ set_source_filename (jcf, index)
|
|||
#include "jcf-reader.c"
|
||||
|
||||
tree
|
||||
parse_signature (jcf, sig_index)
|
||||
JCF *jcf;
|
||||
int sig_index;
|
||||
parse_signature (JCF *jcf, int sig_index)
|
||||
{
|
||||
if (sig_index <= 0 || sig_index >= JPOOL_SIZE (jcf)
|
||||
|| JPOOL_TAG (jcf, sig_index) != CONSTANT_Utf8)
|
||||
|
@ -236,9 +232,7 @@ parse_signature (jcf, sig_index)
|
|||
}
|
||||
|
||||
tree
|
||||
get_constant (jcf, index)
|
||||
JCF *jcf;
|
||||
int index;
|
||||
get_constant (JCF *jcf, int index)
|
||||
{
|
||||
tree value;
|
||||
int tag;
|
||||
|
@ -336,9 +330,7 @@ get_constant (jcf, index)
|
|||
}
|
||||
|
||||
tree
|
||||
get_name_constant (jcf, index)
|
||||
JCF *jcf;
|
||||
int index;
|
||||
get_name_constant (JCF *jcf, int index)
|
||||
{
|
||||
tree name = get_constant (jcf, index);
|
||||
|
||||
|
@ -353,9 +345,7 @@ get_name_constant (jcf, index)
|
|||
the outer context with the newly resolved innerclass. */
|
||||
|
||||
static void
|
||||
handle_innerclass_attribute (count, jcf)
|
||||
int count;
|
||||
JCF *jcf;
|
||||
handle_innerclass_attribute (int count, JCF *jcf)
|
||||
{
|
||||
int c = (count);
|
||||
while (c--)
|
||||
|
@ -391,9 +381,7 @@ handle_innerclass_attribute (count, jcf)
|
|||
}
|
||||
|
||||
static tree
|
||||
give_name_to_class (jcf, i)
|
||||
JCF *jcf;
|
||||
int i;
|
||||
give_name_to_class (JCF *jcf, int i)
|
||||
{
|
||||
if (i <= 0 || i >= JPOOL_SIZE (jcf)
|
||||
|| JPOOL_TAG (jcf, i) != CONSTANT_Class)
|
||||
|
@ -420,7 +408,7 @@ give_name_to_class (jcf, i)
|
|||
/* Get the class of the CONSTANT_Class whose constant pool index is I. */
|
||||
|
||||
tree
|
||||
get_class_constant (JCF *jcf , int i)
|
||||
get_class_constant (JCF *jcf, int i)
|
||||
{
|
||||
tree type;
|
||||
if (i <= 0 || i >= JPOOL_SIZE (jcf)
|
||||
|
@ -455,8 +443,7 @@ get_class_constant (JCF *jcf , int i)
|
|||
define the class it is supposed to.) */
|
||||
|
||||
int
|
||||
read_class (name)
|
||||
tree name;
|
||||
read_class (tree name)
|
||||
{
|
||||
JCF this_jcf, *jcf;
|
||||
tree icv, class = NULL_TREE;
|
||||
|
@ -548,9 +535,7 @@ read_class (name)
|
|||
- and then perhaps rename read_class to load_class. FIXME */
|
||||
|
||||
void
|
||||
load_class (class_or_name, verbose)
|
||||
tree class_or_name;
|
||||
int verbose;
|
||||
load_class (tree class_or_name, int verbose)
|
||||
{
|
||||
tree name, saved;
|
||||
int class_loaded;
|
||||
|
@ -596,8 +581,7 @@ load_class (class_or_name, verbose)
|
|||
/* Parse the .class file JCF. */
|
||||
|
||||
void
|
||||
jcf_parse (jcf)
|
||||
JCF* jcf;
|
||||
jcf_parse (JCF* jcf)
|
||||
{
|
||||
int i, code;
|
||||
|
||||
|
@ -667,8 +651,7 @@ jcf_parse (jcf)
|
|||
|
||||
/* If we came across inner classes, load them now. */
|
||||
static void
|
||||
load_inner_classes (cur_class)
|
||||
tree cur_class;
|
||||
load_inner_classes (tree cur_class)
|
||||
{
|
||||
tree current;
|
||||
for (current = DECL_INNER_CLASS_LIST (TYPE_NAME (cur_class)); current;
|
||||
|
@ -683,13 +666,13 @@ load_inner_classes (cur_class)
|
|||
}
|
||||
|
||||
void
|
||||
init_outgoing_cpool ()
|
||||
init_outgoing_cpool (void)
|
||||
{
|
||||
outgoing_cpool = ggc_alloc_cleared (sizeof (struct CPool));
|
||||
}
|
||||
|
||||
static void
|
||||
parse_class_file ()
|
||||
parse_class_file (void)
|
||||
{
|
||||
tree method, field;
|
||||
const char *save_input_filename = input_filename;
|
||||
|
@ -799,9 +782,7 @@ parse_class_file ()
|
|||
/* Parse a source file, as pointed by the current value of INPUT_FILENAME. */
|
||||
|
||||
static void
|
||||
parse_source_file_1 (file, finput)
|
||||
tree file;
|
||||
FILE *finput;
|
||||
parse_source_file_1 (tree file, FILE *finput)
|
||||
{
|
||||
int save_error_count = java_error_count;
|
||||
/* Mark the file as parsed */
|
||||
|
@ -833,7 +814,7 @@ parse_source_file_1 (file, finput)
|
|||
/* Process a parsed source file, resolving names etc. */
|
||||
|
||||
static void
|
||||
parse_source_file_2 ()
|
||||
parse_source_file_2 (void)
|
||||
{
|
||||
int save_error_count = java_error_count;
|
||||
java_complete_class (); /* Parse unsatisfied class decl. */
|
||||
|
@ -841,7 +822,7 @@ parse_source_file_2 ()
|
|||
}
|
||||
|
||||
static void
|
||||
parse_source_file_3 ()
|
||||
parse_source_file_3 (void)
|
||||
{
|
||||
int save_error_count = java_error_count;
|
||||
java_check_circular_reference (); /* Check on circular references */
|
||||
|
@ -852,15 +833,13 @@ parse_source_file_3 ()
|
|||
}
|
||||
|
||||
void
|
||||
add_predefined_file (name)
|
||||
tree name;
|
||||
add_predefined_file (tree name)
|
||||
{
|
||||
predef_filenames = tree_cons (NULL_TREE, name, predef_filenames);
|
||||
}
|
||||
|
||||
int
|
||||
predefined_filename_p (node)
|
||||
tree node;
|
||||
predefined_filename_p (tree node)
|
||||
{
|
||||
tree iter;
|
||||
|
||||
|
@ -873,8 +852,7 @@ predefined_filename_p (node)
|
|||
}
|
||||
|
||||
void
|
||||
java_parse_file (set_yydebug)
|
||||
int set_yydebug ATTRIBUTE_UNUSED;
|
||||
java_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
|
||||
{
|
||||
int filename_count = 0;
|
||||
char *list, *next;
|
||||
|
@ -1229,7 +1207,7 @@ process_zip_dir (FILE *finput)
|
|||
/* Initialization. */
|
||||
|
||||
void
|
||||
init_jcf_parse ()
|
||||
init_jcf_parse (void)
|
||||
{
|
||||
init_src_parse ();
|
||||
}
|
||||
|
|
|
@ -105,8 +105,7 @@ static int longest_path = 0;
|
|||
|
||||
|
||||
static void
|
||||
free_entry (entp)
|
||||
struct entry **entp;
|
||||
free_entry (struct entry **entp)
|
||||
{
|
||||
struct entry *e, *n;
|
||||
|
||||
|
@ -120,9 +119,7 @@ free_entry (entp)
|
|||
}
|
||||
|
||||
static void
|
||||
append_entry (entp, ent)
|
||||
struct entry **entp;
|
||||
struct entry *ent;
|
||||
append_entry (struct entry **entp, struct entry *ent)
|
||||
{
|
||||
/* It doesn't matter if this is slow, since it is run only at
|
||||
startup, and then infrequently. */
|
||||
|
@ -139,10 +136,7 @@ append_entry (entp, ent)
|
|||
}
|
||||
|
||||
static void
|
||||
add_entry (entp, filename, is_system)
|
||||
struct entry **entp;
|
||||
const char *filename;
|
||||
int is_system;
|
||||
add_entry (struct entry **entp, const char *filename, int is_system)
|
||||
{
|
||||
int len;
|
||||
struct entry *n;
|
||||
|
@ -186,10 +180,7 @@ add_entry (entp, filename, is_system)
|
|||
}
|
||||
|
||||
static void
|
||||
add_path (entp, cp, is_system)
|
||||
struct entry **entp;
|
||||
const char *cp;
|
||||
int is_system;
|
||||
add_path (struct entry **entp, const char *cp, int is_system)
|
||||
{
|
||||
const char *startp, *endp;
|
||||
|
||||
|
@ -228,7 +219,7 @@ static int init_done = 0;
|
|||
|
||||
/* Initialize the path module. */
|
||||
void
|
||||
jcf_path_init ()
|
||||
jcf_path_init (void)
|
||||
{
|
||||
char *cp;
|
||||
char *try, sep[2];
|
||||
|
@ -321,8 +312,7 @@ jcf_path_init ()
|
|||
This overrides only the $CLASSPATH environment variable.
|
||||
*/
|
||||
void
|
||||
jcf_path_classpath_arg (path)
|
||||
const char *path;
|
||||
jcf_path_classpath_arg (const char *path)
|
||||
{
|
||||
free_entry (&classpath_user);
|
||||
add_path (&classpath_user, path, 0);
|
||||
|
@ -331,8 +321,7 @@ jcf_path_classpath_arg (path)
|
|||
/* Call this when -bootclasspath is seen on the command line.
|
||||
*/
|
||||
void
|
||||
jcf_path_bootclasspath_arg (path)
|
||||
const char *path;
|
||||
jcf_path_bootclasspath_arg (const char *path)
|
||||
{
|
||||
free_entry (&sys_dirs);
|
||||
add_path (&sys_dirs, path, 1);
|
||||
|
@ -341,8 +330,7 @@ jcf_path_bootclasspath_arg (path)
|
|||
/* Call this when -extdirs is seen on the command line.
|
||||
*/
|
||||
void
|
||||
jcf_path_extdirs_arg (cp)
|
||||
const char *cp;
|
||||
jcf_path_extdirs_arg (const char *cp)
|
||||
{
|
||||
const char *startp, *endp;
|
||||
|
||||
|
@ -406,8 +394,7 @@ jcf_path_extdirs_arg (cp)
|
|||
|
||||
/* Call this when -I is seen on the command line. */
|
||||
void
|
||||
jcf_path_include_arg (path)
|
||||
const char *path;
|
||||
jcf_path_include_arg (const char *path)
|
||||
{
|
||||
add_entry (&include_dirs, path, 0);
|
||||
}
|
||||
|
@ -416,8 +403,7 @@ jcf_path_include_arg (path)
|
|||
we provide a way to iterate through the sealed list. If PRINT is
|
||||
true then we print the final class path to stderr. */
|
||||
void
|
||||
jcf_path_seal (print)
|
||||
int print;
|
||||
jcf_path_seal (int print)
|
||||
{
|
||||
struct entry *secondary;
|
||||
|
||||
|
@ -465,14 +451,13 @@ jcf_path_seal (print)
|
|||
}
|
||||
|
||||
void *
|
||||
jcf_path_start ()
|
||||
jcf_path_start (void)
|
||||
{
|
||||
return (void *) sealed;
|
||||
}
|
||||
|
||||
void *
|
||||
jcf_path_next (x)
|
||||
void *x;
|
||||
jcf_path_next (void *x)
|
||||
{
|
||||
struct entry *ent = (struct entry *) x;
|
||||
return (void *) ent->next;
|
||||
|
@ -481,31 +466,28 @@ jcf_path_next (x)
|
|||
/* We guarantee that the return path will either be a zip file, or it
|
||||
will end with a directory separator. */
|
||||
char *
|
||||
jcf_path_name (x)
|
||||
void *x;
|
||||
jcf_path_name (void *x)
|
||||
{
|
||||
struct entry *ent = (struct entry *) x;
|
||||
return ent->name;
|
||||
}
|
||||
|
||||
int
|
||||
jcf_path_is_zipfile (x)
|
||||
void *x;
|
||||
jcf_path_is_zipfile (void *x)
|
||||
{
|
||||
struct entry *ent = (struct entry *) x;
|
||||
return (ent->flags & FLAG_ZIP);
|
||||
}
|
||||
|
||||
int
|
||||
jcf_path_is_system (x)
|
||||
void *x;
|
||||
jcf_path_is_system (void *x)
|
||||
{
|
||||
struct entry *ent = (struct entry *) x;
|
||||
return (ent->flags & FLAG_SYSTEM);
|
||||
}
|
||||
|
||||
int
|
||||
jcf_path_max_len ()
|
||||
jcf_path_max_len (void)
|
||||
{
|
||||
return longest_path;
|
||||
}
|
||||
|
|
|
@ -50,11 +50,8 @@ static void skip_attribute (JCF *, int);
|
|||
|
||||
#ifdef NEED_PEEK_ATTRIBUTE /* Not everyone uses this function */
|
||||
static int
|
||||
peek_attribute (jcf, attribute_number, peeked_name, peeked_name_length)
|
||||
JCF *jcf;
|
||||
int attribute_number;
|
||||
const char *peeked_name;
|
||||
int peeked_name_length;
|
||||
peek_attribute (JCF *jcf, int attribute_number, const char *peeked_name,
|
||||
int peeked_name_length)
|
||||
{
|
||||
int to_return = 0;
|
||||
long absolute_offset = (long)JCF_TELL (jcf);
|
||||
|
@ -92,9 +89,7 @@ peek_attribute (jcf, attribute_number, peeked_name, peeked_name_length)
|
|||
|
||||
#ifdef NEED_SKIP_ATTRIBUTE /* Not everyone uses this function */
|
||||
static void
|
||||
skip_attribute (jcf, number_of_attribute)
|
||||
JCF *jcf;
|
||||
int number_of_attribute;
|
||||
skip_attribute (JCF *jcf, int number_of_attribute)
|
||||
{
|
||||
while (number_of_attribute--)
|
||||
{
|
||||
|
|
|
@ -352,10 +352,7 @@ static void append_gcj_attribute (struct jcf_partial *, tree);
|
|||
static int CHECK_PUT (void *, struct jcf_partial *, int);
|
||||
|
||||
static int
|
||||
CHECK_PUT (ptr, state, i)
|
||||
void *ptr;
|
||||
struct jcf_partial *state;
|
||||
int i;
|
||||
CHECK_PUT (void *ptr, struct jcf_partial *state, int i)
|
||||
{
|
||||
if ((unsigned char *) ptr < state->chunk->data
|
||||
|| (unsigned char *) ptr + i > state->chunk->data + state->chunk->size)
|
||||
|
@ -385,11 +382,8 @@ CHECK_PUT (ptr, state, i)
|
|||
However, if DATA is NULL and SIZE>0, allocate a buffer as well. */
|
||||
|
||||
static struct chunk *
|
||||
alloc_chunk (last, data, size, work)
|
||||
struct chunk *last;
|
||||
unsigned char *data;
|
||||
int size;
|
||||
struct obstack *work;
|
||||
alloc_chunk (struct chunk *last, unsigned char *data,
|
||||
int size, struct obstack *work)
|
||||
{
|
||||
struct chunk *chunk = (struct chunk *)
|
||||
obstack_alloc (work, sizeof(struct chunk));
|
||||
|
@ -409,8 +403,7 @@ alloc_chunk (last, data, size, work)
|
|||
static int CHECK_OP (struct jcf_partial *);
|
||||
|
||||
static int
|
||||
CHECK_OP (state)
|
||||
struct jcf_partial *state;
|
||||
CHECK_OP (struct jcf_partial *state)
|
||||
{
|
||||
if (state->bytecode.ptr > state->bytecode.limit)
|
||||
abort ();
|
||||
|
@ -422,10 +415,7 @@ CHECK_OP (state)
|
|||
#endif
|
||||
|
||||
static unsigned char *
|
||||
append_chunk (data, size, state)
|
||||
unsigned char *data;
|
||||
int size;
|
||||
struct jcf_partial *state;
|
||||
append_chunk (unsigned char *data, int size, struct jcf_partial *state)
|
||||
{
|
||||
state->chunk = alloc_chunk (state->chunk, data, size, state->chunk_obstack);
|
||||
if (state->first == NULL)
|
||||
|
@ -434,18 +424,14 @@ append_chunk (data, size, state)
|
|||
}
|
||||
|
||||
static void
|
||||
append_chunk_copy (data, size, state)
|
||||
unsigned char *data;
|
||||
int size;
|
||||
struct jcf_partial *state;
|
||||
append_chunk_copy (unsigned char *data, int size, struct jcf_partial *state)
|
||||
{
|
||||
unsigned char *ptr = append_chunk (NULL, size, state);
|
||||
memcpy (ptr, data, size);
|
||||
}
|
||||
|
||||
static struct jcf_block *
|
||||
gen_jcf_label (state)
|
||||
struct jcf_partial *state;
|
||||
gen_jcf_label (struct jcf_partial *state)
|
||||
{
|
||||
struct jcf_block *block = (struct jcf_block *)
|
||||
obstack_alloc (state->chunk_obstack, sizeof (struct jcf_block));
|
||||
|
@ -456,8 +442,7 @@ gen_jcf_label (state)
|
|||
}
|
||||
|
||||
static void
|
||||
finish_jcf_block (state)
|
||||
struct jcf_partial *state;
|
||||
finish_jcf_block (struct jcf_partial *state)
|
||||
{
|
||||
struct jcf_block *block = state->last_block;
|
||||
struct jcf_relocation *reloc;
|
||||
|
@ -483,9 +468,7 @@ finish_jcf_block (state)
|
|||
}
|
||||
|
||||
static void
|
||||
define_jcf_label (label, state)
|
||||
struct jcf_block *label;
|
||||
struct jcf_partial *state;
|
||||
define_jcf_label (struct jcf_block *label, struct jcf_partial *state)
|
||||
{
|
||||
if (state->last_block != NULL)
|
||||
finish_jcf_block (state);
|
||||
|
@ -500,8 +483,7 @@ define_jcf_label (label, state)
|
|||
}
|
||||
|
||||
static struct jcf_block *
|
||||
get_jcf_label_here (state)
|
||||
struct jcf_partial *state;
|
||||
get_jcf_label_here (struct jcf_partial *state)
|
||||
{
|
||||
if (state->last_block != NULL && BUFFER_LENGTH (&state->bytecode) == 0)
|
||||
return state->last_block;
|
||||
|
@ -516,9 +498,7 @@ get_jcf_label_here (state)
|
|||
/* Note a line number entry for the current PC and given LINE. */
|
||||
|
||||
static void
|
||||
put_linenumber (line, state)
|
||||
int line;
|
||||
struct jcf_partial *state;
|
||||
put_linenumber (int line, struct jcf_partial *state)
|
||||
{
|
||||
struct jcf_block *label = get_jcf_label_here (state);
|
||||
if (label->linenumber > 0)
|
||||
|
@ -534,10 +514,8 @@ put_linenumber (line, state)
|
|||
in the range (START_LABEL, END_LABEL). */
|
||||
|
||||
static struct jcf_handler *
|
||||
alloc_handler (start_label, end_label, state)
|
||||
struct jcf_block *start_label;
|
||||
struct jcf_block *end_label;
|
||||
struct jcf_partial *state;
|
||||
alloc_handler (struct jcf_block *start_label, struct jcf_block *end_label,
|
||||
struct jcf_partial *state)
|
||||
{
|
||||
struct jcf_handler *handler = (struct jcf_handler *)
|
||||
obstack_alloc (state->chunk_obstack, sizeof (struct jcf_handler));
|
||||
|
@ -576,9 +554,7 @@ struct localvar_info
|
|||
((struct localvar_info**) state->localvars.ptr - localvar_buffer)
|
||||
|
||||
static void
|
||||
localvar_alloc (decl, state)
|
||||
tree decl;
|
||||
struct jcf_partial *state;
|
||||
localvar_alloc (tree decl, struct jcf_partial *state)
|
||||
{
|
||||
struct jcf_block *start_label = get_jcf_label_here (state);
|
||||
int wide = TYPE_IS_WIDE (TREE_TYPE (decl));
|
||||
|
@ -623,9 +599,7 @@ localvar_alloc (decl, state)
|
|||
}
|
||||
|
||||
static void
|
||||
localvar_free (decl, state)
|
||||
tree decl;
|
||||
struct jcf_partial *state;
|
||||
localvar_free (tree decl, struct jcf_partial *state)
|
||||
{
|
||||
struct jcf_block *end_label = get_jcf_label_here (state);
|
||||
int index = DECL_LOCAL_INDEX (decl);
|
||||
|
@ -654,8 +628,7 @@ localvar_free (decl, state)
|
|||
a field (FIELD_DECL or VAR_DECL, if static), as encoded in a .class file. */
|
||||
|
||||
static int
|
||||
get_access_flags (decl)
|
||||
tree decl;
|
||||
get_access_flags (tree decl)
|
||||
{
|
||||
int flags = 0;
|
||||
int isfield = TREE_CODE (decl) == FIELD_DECL || TREE_CODE (decl) == VAR_DECL;
|
||||
|
@ -721,9 +694,7 @@ get_access_flags (decl)
|
|||
/* Write the list of segments starting at CHUNKS to STREAM. */
|
||||
|
||||
static void
|
||||
write_chunks (stream, chunks)
|
||||
FILE* stream;
|
||||
struct chunk *chunks;
|
||||
write_chunks (FILE* stream, struct chunk *chunks)
|
||||
{
|
||||
for (; chunks != NULL; chunks = chunks->next)
|
||||
fwrite (chunks->data, chunks->size, 1, stream);
|
||||
|
@ -733,9 +704,7 @@ write_chunks (stream, chunks)
|
|||
(Caller is responsible for doing NOTE_PUSH.) */
|
||||
|
||||
static void
|
||||
push_constant1 (index, state)
|
||||
HOST_WIDE_INT index;
|
||||
struct jcf_partial *state;
|
||||
push_constant1 (HOST_WIDE_INT index, struct jcf_partial *state)
|
||||
{
|
||||
RESERVE (3);
|
||||
if (index < 256)
|
||||
|
@ -754,9 +723,7 @@ push_constant1 (index, state)
|
|||
(Caller is responsible for doing NOTE_PUSH.) */
|
||||
|
||||
static void
|
||||
push_constant2 (index, state)
|
||||
HOST_WIDE_INT index;
|
||||
struct jcf_partial *state;
|
||||
push_constant2 (HOST_WIDE_INT index, struct jcf_partial *state)
|
||||
{
|
||||
RESERVE (3);
|
||||
OP1 (OPCODE_ldc2_w);
|
||||
|
@ -767,9 +734,7 @@ push_constant2 (index, state)
|
|||
Caller is responsible for doing NOTE_PUSH. */
|
||||
|
||||
static void
|
||||
push_int_const (i, state)
|
||||
HOST_WIDE_INT i;
|
||||
struct jcf_partial *state;
|
||||
push_int_const (HOST_WIDE_INT i, struct jcf_partial *state)
|
||||
{
|
||||
RESERVE(3);
|
||||
if (i >= -1 && i <= 5)
|
||||
|
@ -793,9 +758,8 @@ push_int_const (i, state)
|
|||
}
|
||||
|
||||
static int
|
||||
find_constant_wide (lo, hi, state)
|
||||
HOST_WIDE_INT lo, hi;
|
||||
struct jcf_partial *state;
|
||||
find_constant_wide (HOST_WIDE_INT lo, HOST_WIDE_INT hi,
|
||||
struct jcf_partial *state)
|
||||
{
|
||||
HOST_WIDE_INT w1, w2;
|
||||
lshift_double (lo, hi, -32, 64, &w1, &w2, 1);
|
||||
|
@ -807,9 +771,7 @@ find_constant_wide (lo, hi, state)
|
|||
Return the index in the constant pool. */
|
||||
|
||||
static int
|
||||
find_constant_index (value, state)
|
||||
tree value;
|
||||
struct jcf_partial *state;
|
||||
find_constant_index (tree value, struct jcf_partial *state)
|
||||
{
|
||||
if (TREE_CODE (value) == INTEGER_CST)
|
||||
{
|
||||
|
@ -847,9 +809,7 @@ find_constant_index (value, state)
|
|||
Caller is responsible for doing NOTE_PUSH. */
|
||||
|
||||
static void
|
||||
push_long_const (lo, hi, state)
|
||||
HOST_WIDE_INT lo, hi;
|
||||
struct jcf_partial *state;
|
||||
push_long_const (HOST_WIDE_INT lo, HOST_WIDE_INT hi, struct jcf_partial *state)
|
||||
{
|
||||
HOST_WIDE_INT highpart, dummy;
|
||||
jint lowpart = WORD_TO_INT (lo);
|
||||
|
@ -873,10 +833,7 @@ push_long_const (lo, hi, state)
|
|||
}
|
||||
|
||||
static void
|
||||
field_op (field, opcode, state)
|
||||
tree field;
|
||||
int opcode;
|
||||
struct jcf_partial *state;
|
||||
field_op (tree field, int opcode, struct jcf_partial *state)
|
||||
{
|
||||
int index = find_fieldref_index (&state->cpool, field);
|
||||
RESERVE (3);
|
||||
|
@ -889,9 +846,7 @@ field_op (field, opcode, state)
|
|||
opcodes typically depend on the operand type. */
|
||||
|
||||
static int
|
||||
adjust_typed_op (type, max)
|
||||
tree type;
|
||||
int max;
|
||||
adjust_typed_op (tree type, int max)
|
||||
{
|
||||
switch (TREE_CODE (type))
|
||||
{
|
||||
|
@ -924,9 +879,7 @@ adjust_typed_op (type, max)
|
|||
}
|
||||
|
||||
static void
|
||||
maybe_wide (opcode, index, state)
|
||||
int opcode, index;
|
||||
struct jcf_partial *state;
|
||||
maybe_wide (int opcode, int index, struct jcf_partial *state)
|
||||
{
|
||||
if (index >= 256)
|
||||
{
|
||||
|
@ -949,9 +902,7 @@ maybe_wide (opcode, index, state)
|
|||
(The new words get inserted at stack[SP-size-offset].) */
|
||||
|
||||
static void
|
||||
emit_dup (size, offset, state)
|
||||
int size, offset;
|
||||
struct jcf_partial *state;
|
||||
emit_dup (int size, int offset, struct jcf_partial *state)
|
||||
{
|
||||
int kind;
|
||||
if (size == 0)
|
||||
|
@ -970,19 +921,14 @@ emit_dup (size, offset, state)
|
|||
}
|
||||
|
||||
static void
|
||||
emit_pop (size, state)
|
||||
int size;
|
||||
struct jcf_partial *state;
|
||||
emit_pop (int size, struct jcf_partial *state)
|
||||
{
|
||||
RESERVE (1);
|
||||
OP1 (OPCODE_pop - 1 + size);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_iinc (var, value, state)
|
||||
tree var;
|
||||
HOST_WIDE_INT value;
|
||||
struct jcf_partial *state;
|
||||
emit_iinc (tree var, HOST_WIDE_INT value, struct jcf_partial *state)
|
||||
{
|
||||
int slot = DECL_LOCAL_INDEX (var);
|
||||
|
||||
|
@ -1004,10 +950,9 @@ emit_iinc (var, value, state)
|
|||
}
|
||||
|
||||
static void
|
||||
emit_load_or_store (var, opcode, state)
|
||||
tree var; /* Variable to load from or store into. */
|
||||
int opcode; /* Either OPCODE_iload or OPCODE_istore. */
|
||||
struct jcf_partial *state;
|
||||
emit_load_or_store (tree var, /* Variable to load from or store into. */
|
||||
int opcode, /* Either OPCODE_iload or OPCODE_istore. */
|
||||
struct jcf_partial *state)
|
||||
{
|
||||
tree type = TREE_TYPE (var);
|
||||
int kind = adjust_typed_op (type, 4);
|
||||
|
@ -1022,38 +967,29 @@ emit_load_or_store (var, opcode, state)
|
|||
}
|
||||
|
||||
static void
|
||||
emit_load (var, state)
|
||||
tree var;
|
||||
struct jcf_partial *state;
|
||||
emit_load (tree var, struct jcf_partial *state)
|
||||
{
|
||||
emit_load_or_store (var, OPCODE_iload, state);
|
||||
NOTE_PUSH (TYPE_IS_WIDE (TREE_TYPE (var)) ? 2 : 1);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_store (var, state)
|
||||
tree var;
|
||||
struct jcf_partial *state;
|
||||
emit_store (tree var, struct jcf_partial *state)
|
||||
{
|
||||
emit_load_or_store (var, OPCODE_istore, state);
|
||||
NOTE_POP (TYPE_IS_WIDE (TREE_TYPE (var)) ? 2 : 1);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_unop (opcode, type, state)
|
||||
enum java_opcode opcode;
|
||||
tree type ATTRIBUTE_UNUSED;
|
||||
struct jcf_partial *state;
|
||||
emit_unop (enum java_opcode opcode, tree type ATTRIBUTE_UNUSED,
|
||||
struct jcf_partial *state)
|
||||
{
|
||||
RESERVE(1);
|
||||
OP1 (opcode);
|
||||
}
|
||||
|
||||
static void
|
||||
emit_binop (opcode, type, state)
|
||||
enum java_opcode opcode;
|
||||
tree type;
|
||||
struct jcf_partial *state;
|
||||
emit_binop (enum java_opcode opcode, tree type, struct jcf_partial *state)
|
||||
{
|
||||
int size = TYPE_IS_WIDE (type) ? 2 : 1;
|
||||
RESERVE(1);
|
||||
|
@ -1062,11 +998,8 @@ emit_binop (opcode, type, state)
|
|||
}
|
||||
|
||||
static void
|
||||
emit_reloc (value, kind, target, state)
|
||||
HOST_WIDE_INT value;
|
||||
int kind;
|
||||
struct jcf_block *target;
|
||||
struct jcf_partial *state;
|
||||
emit_reloc (HOST_WIDE_INT value, int kind,
|
||||
struct jcf_block *target, struct jcf_partial *state)
|
||||
{
|
||||
struct jcf_relocation *reloc = (struct jcf_relocation *)
|
||||
obstack_alloc (state->chunk_obstack, sizeof (struct jcf_relocation));
|
||||
|
@ -1083,9 +1016,7 @@ emit_reloc (value, kind, target, state)
|
|||
}
|
||||
|
||||
static void
|
||||
emit_switch_reloc (label, state)
|
||||
struct jcf_block *label;
|
||||
struct jcf_partial *state;
|
||||
emit_switch_reloc (struct jcf_block *label, struct jcf_partial *state)
|
||||
{
|
||||
emit_reloc (RELOCATION_VALUE_0, BLOCK_START_RELOC, label, state);
|
||||
}
|
||||
|
@ -1094,9 +1025,7 @@ emit_switch_reloc (label, state)
|
|||
but re-uses an existing case reloc. */
|
||||
|
||||
static void
|
||||
emit_case_reloc (reloc, state)
|
||||
struct jcf_relocation *reloc;
|
||||
struct jcf_partial *state;
|
||||
emit_case_reloc (struct jcf_relocation *reloc, struct jcf_partial *state)
|
||||
{
|
||||
struct jcf_block *block = state->last_block;
|
||||
reloc->next = block->u.relocations;
|
||||
|
@ -1110,10 +1039,8 @@ emit_case_reloc (reloc, state)
|
|||
The opcode is OPCODE, the inverted opcode is INV_OPCODE. */
|
||||
|
||||
static void
|
||||
emit_if (target, opcode, inv_opcode, state)
|
||||
struct jcf_block *target;
|
||||
int opcode, inv_opcode;
|
||||
struct jcf_partial *state;
|
||||
emit_if (struct jcf_block *target, int opcode, int inv_opcode,
|
||||
struct jcf_partial *state)
|
||||
{
|
||||
RESERVE(3);
|
||||
OP1 (opcode);
|
||||
|
@ -1122,9 +1049,7 @@ emit_if (target, opcode, inv_opcode, state)
|
|||
}
|
||||
|
||||
static void
|
||||
emit_goto (target, state)
|
||||
struct jcf_block *target;
|
||||
struct jcf_partial *state;
|
||||
emit_goto (struct jcf_block *target, struct jcf_partial *state)
|
||||
{
|
||||
RESERVE(3);
|
||||
OP1 (OPCODE_goto);
|
||||
|
@ -1133,9 +1058,7 @@ emit_goto (target, state)
|
|||
}
|
||||
|
||||
static void
|
||||
emit_jsr (target, state)
|
||||
struct jcf_block *target;
|
||||
struct jcf_partial *state;
|
||||
emit_jsr (struct jcf_block *target, struct jcf_partial *state)
|
||||
{
|
||||
RESERVE(3);
|
||||
OP1 (OPCODE_jsr);
|
||||
|
@ -1150,13 +1073,11 @@ emit_jsr (target, state)
|
|||
may be able to optimize away GOTO TRUE_LABEL; TRUE_LABEL:) */
|
||||
|
||||
static void
|
||||
generate_bytecode_conditional (exp, true_label, false_label,
|
||||
true_branch_first, state)
|
||||
tree exp;
|
||||
struct jcf_block *true_label;
|
||||
struct jcf_block *false_label;
|
||||
int true_branch_first;
|
||||
struct jcf_partial *state;
|
||||
generate_bytecode_conditional (tree exp,
|
||||
struct jcf_block *true_label,
|
||||
struct jcf_block *false_label,
|
||||
int true_branch_first,
|
||||
struct jcf_partial *state)
|
||||
{
|
||||
tree exp0, exp1, type;
|
||||
int save_SP = state->code_SP;
|
||||
|
@ -1361,9 +1282,7 @@ generate_bytecode_conditional (exp, true_label, false_label,
|
|||
emit label that is LIMIT). */
|
||||
|
||||
static void
|
||||
call_cleanups (limit, state)
|
||||
struct jcf_block *limit;
|
||||
struct jcf_partial *state;
|
||||
call_cleanups (struct jcf_block *limit, struct jcf_partial *state)
|
||||
{
|
||||
struct jcf_block *block = state->labeled_blocks;
|
||||
for (; block != limit; block = block->next)
|
||||
|
@ -1374,9 +1293,7 @@ call_cleanups (limit, state)
|
|||
}
|
||||
|
||||
static void
|
||||
generate_bytecode_return (exp, state)
|
||||
tree exp;
|
||||
struct jcf_partial *state;
|
||||
generate_bytecode_return (tree exp, struct jcf_partial *state)
|
||||
{
|
||||
tree return_type = TREE_TYPE (TREE_TYPE (state->current_method));
|
||||
int returns_void = TREE_CODE (return_type) == VOID_TYPE;
|
||||
|
@ -1443,10 +1360,7 @@ generate_bytecode_return (exp, state)
|
|||
TARGET is one of STACK_TARGET or IGNORE_TARGET. */
|
||||
|
||||
static void
|
||||
generate_bytecode_insns (exp, target, state)
|
||||
tree exp;
|
||||
int target;
|
||||
struct jcf_partial *state;
|
||||
generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
|
||||
{
|
||||
tree type, arg;
|
||||
enum java_opcode jopcode;
|
||||
|
@ -2641,8 +2555,7 @@ generate_bytecode_insns (exp, target, state)
|
|||
}
|
||||
|
||||
static void
|
||||
perform_relocations (state)
|
||||
struct jcf_partial *state;
|
||||
perform_relocations (struct jcf_partial *state)
|
||||
{
|
||||
struct jcf_block *block;
|
||||
struct jcf_relocation *reloc;
|
||||
|
@ -2840,9 +2753,7 @@ perform_relocations (state)
|
|||
}
|
||||
|
||||
static void
|
||||
init_jcf_state (state, work)
|
||||
struct jcf_partial *state;
|
||||
struct obstack *work;
|
||||
init_jcf_state (struct jcf_partial *state, struct obstack *work)
|
||||
{
|
||||
state->chunk_obstack = work;
|
||||
state->first = state->chunk = NULL;
|
||||
|
@ -2852,9 +2763,7 @@ init_jcf_state (state, work)
|
|||
}
|
||||
|
||||
static void
|
||||
init_jcf_method (state, method)
|
||||
struct jcf_partial *state;
|
||||
tree method;
|
||||
init_jcf_method (struct jcf_partial *state, tree method)
|
||||
{
|
||||
state->current_method = method;
|
||||
state->blocks = state->last_block = NULL;
|
||||
|
@ -2875,8 +2784,7 @@ init_jcf_method (state, method)
|
|||
}
|
||||
|
||||
static void
|
||||
release_jcf_state (state)
|
||||
struct jcf_partial *state;
|
||||
release_jcf_state (struct jcf_partial *state)
|
||||
{
|
||||
CPOOL_FINISH (&state->cpool);
|
||||
obstack_free (state->chunk_obstack, state->first);
|
||||
|
@ -2888,9 +2796,7 @@ release_jcf_state (state)
|
|||
|
||||
static GTY(()) tree SourceFile_node;
|
||||
static struct chunk *
|
||||
generate_classfile (clas, state)
|
||||
tree clas;
|
||||
struct jcf_partial *state;
|
||||
generate_classfile (tree clas, struct jcf_partial *state)
|
||||
{
|
||||
struct chunk *cpool_chunk;
|
||||
const char *source_file, *s;
|
||||
|
@ -3210,8 +3116,7 @@ generate_classfile (clas, state)
|
|||
|
||||
static GTY(()) tree Synthetic_node;
|
||||
static unsigned char *
|
||||
append_synthetic_attribute (state)
|
||||
struct jcf_partial *state;
|
||||
append_synthetic_attribute (struct jcf_partial *state)
|
||||
{
|
||||
unsigned char *ptr = append_chunk (NULL, 6, state);
|
||||
int i;
|
||||
|
@ -3228,9 +3133,7 @@ append_synthetic_attribute (state)
|
|||
}
|
||||
|
||||
static void
|
||||
append_gcj_attribute (state, class)
|
||||
struct jcf_partial *state;
|
||||
tree class;
|
||||
append_gcj_attribute (struct jcf_partial *state, tree class)
|
||||
{
|
||||
unsigned char *ptr;
|
||||
int i;
|
||||
|
@ -3247,9 +3150,7 @@ append_gcj_attribute (state, class)
|
|||
|
||||
static tree InnerClasses_node;
|
||||
static void
|
||||
append_innerclasses_attribute (state, class)
|
||||
struct jcf_partial *state;
|
||||
tree class;
|
||||
append_innerclasses_attribute (struct jcf_partial *state, tree class)
|
||||
{
|
||||
tree orig_decl = TYPE_NAME (class);
|
||||
tree current, decl;
|
||||
|
@ -3302,9 +3203,8 @@ append_innerclasses_attribute (state, class)
|
|||
}
|
||||
|
||||
static void
|
||||
append_innerclasses_attribute_entry (state, decl, name)
|
||||
struct jcf_partial *state;
|
||||
tree decl, name;
|
||||
append_innerclasses_attribute_entry (struct jcf_partial *state,
|
||||
tree decl, tree name)
|
||||
{
|
||||
int icii, icaf;
|
||||
int ocii = 0, ini = 0;
|
||||
|
@ -3328,8 +3228,7 @@ append_innerclasses_attribute_entry (state, decl, name)
|
|||
}
|
||||
|
||||
static char *
|
||||
make_class_file_name (clas)
|
||||
tree clas;
|
||||
make_class_file_name (tree clas)
|
||||
{
|
||||
const char *dname, *cname, *slash;
|
||||
char *r;
|
||||
|
@ -3396,8 +3295,7 @@ make_class_file_name (clas)
|
|||
The output .class file name is make_class_file_name(CLAS). */
|
||||
|
||||
void
|
||||
write_classfile (clas)
|
||||
tree clas;
|
||||
write_classfile (tree clas)
|
||||
{
|
||||
struct obstack *work = &temporary_obstack;
|
||||
struct jcf_partial state[1];
|
||||
|
|
|
@ -95,14 +95,14 @@ static const struct option options[] =
|
|||
};
|
||||
|
||||
static void
|
||||
usage ()
|
||||
usage (void)
|
||||
{
|
||||
fprintf (stderr, "Try `jv-scan --help' for more information.\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
static void
|
||||
help ()
|
||||
help (void)
|
||||
{
|
||||
printf ("Usage: jv-scan [OPTION]... FILE...\n\n");
|
||||
printf ("Print useful information read from Java source files.\n\n");
|
||||
|
@ -123,7 +123,7 @@ help ()
|
|||
}
|
||||
|
||||
static void
|
||||
version ()
|
||||
version (void)
|
||||
{
|
||||
printf ("jv-scan (GCC) %s\n\n", version_string);
|
||||
printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n");
|
||||
|
@ -264,8 +264,7 @@ warning (const char *s, ...)
|
|||
}
|
||||
|
||||
void
|
||||
gcc_obstack_init (obstack)
|
||||
struct obstack *obstack;
|
||||
gcc_obstack_init (struct obstack *obstack)
|
||||
{
|
||||
/* Let particular systems override the size of a chunk. */
|
||||
#ifndef OBSTACK_CHUNK_SIZE
|
||||
|
|
|
@ -40,8 +40,7 @@ struct obstack name_obstack;
|
|||
struct obstack *mangle_obstack = &name_obstack;
|
||||
|
||||
void
|
||||
gcc_obstack_init (obstack)
|
||||
struct obstack *obstack;
|
||||
gcc_obstack_init (struct obstack *obstack)
|
||||
{
|
||||
/* Let particular systems override the size of a chunk. */
|
||||
#ifndef OBSTACK_CHUNK_SIZE
|
||||
|
@ -157,8 +156,7 @@ main (int argc, char **argv)
|
|||
|
||||
|
||||
static char *
|
||||
do_mangle_classname (string)
|
||||
const char *string;
|
||||
do_mangle_classname (const char *string)
|
||||
{
|
||||
const char *ptr;
|
||||
int count = 0;
|
||||
|
|
|
@ -292,10 +292,8 @@ const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
|
|||
/* Process an option that can accept a `no-' form.
|
||||
Return 1 if option found, 0 otherwise. */
|
||||
static int
|
||||
process_option_with_no (p, table, table_size)
|
||||
const char *p;
|
||||
const struct string_option *table;
|
||||
int table_size;
|
||||
process_option_with_no (const char *p, const struct string_option *table,
|
||||
int table_size)
|
||||
{
|
||||
int j;
|
||||
|
||||
|
@ -322,9 +320,7 @@ process_option_with_no (p, table, table_size)
|
|||
* return 0, but do not complain if the option is not recognized.
|
||||
*/
|
||||
static int
|
||||
java_decode_option (argc, argv)
|
||||
int argc __attribute__ ((__unused__));
|
||||
char **argv;
|
||||
java_decode_option (int argc __attribute__ ((__unused__)), char **argv)
|
||||
{
|
||||
char *p = argv[0];
|
||||
|
||||
|
@ -509,8 +505,7 @@ java_decode_option (argc, argv)
|
|||
FILE *finput;
|
||||
|
||||
static const char *
|
||||
java_init (filename)
|
||||
const char *filename;
|
||||
java_init (const char *filename)
|
||||
{
|
||||
#if 0
|
||||
extern int flag_minimal_debug;
|
||||
|
@ -599,7 +594,7 @@ java_init (filename)
|
|||
}
|
||||
|
||||
static void
|
||||
java_finish ()
|
||||
java_finish (void)
|
||||
{
|
||||
jcf_dependency_write ();
|
||||
}
|
||||
|
@ -617,9 +612,7 @@ static int decl_bufpos = 0;
|
|||
It length is given by LEN; -1 means the string is nul-terminated. */
|
||||
|
||||
static void
|
||||
put_decl_string (str, len)
|
||||
const char *str;
|
||||
int len;
|
||||
put_decl_string (const char *str, int len)
|
||||
{
|
||||
if (len < 0)
|
||||
len = strlen (str);
|
||||
|
@ -643,8 +636,7 @@ put_decl_string (str, len)
|
|||
/* Append to decl_buf a printable name for NODE. */
|
||||
|
||||
static void
|
||||
put_decl_node (node)
|
||||
tree node;
|
||||
put_decl_node (tree node)
|
||||
{
|
||||
int was_pointer = 0;
|
||||
if (TREE_CODE (node) == POINTER_TYPE)
|
||||
|
@ -719,9 +711,7 @@ put_decl_node (node)
|
|||
which is also called directly by java_print_error_function. */
|
||||
|
||||
const char *
|
||||
lang_printable_name (decl, v)
|
||||
tree decl;
|
||||
int v __attribute__ ((__unused__));
|
||||
lang_printable_name (tree decl, int v __attribute__ ((__unused__)))
|
||||
{
|
||||
decl_bufpos = 0;
|
||||
put_decl_node (decl);
|
||||
|
@ -733,9 +723,7 @@ lang_printable_name (decl, v)
|
|||
space to the DECL name string -- With Leading Space. */
|
||||
|
||||
const char *
|
||||
lang_printable_name_wls (decl, v)
|
||||
tree decl;
|
||||
int v __attribute__ ((__unused__));
|
||||
lang_printable_name_wls (tree decl, int v __attribute__ ((__unused__)))
|
||||
{
|
||||
decl_bufpos = 1;
|
||||
put_decl_node (decl);
|
||||
|
@ -750,9 +738,8 @@ lang_printable_name_wls (decl, v)
|
|||
static GTY(()) tree last_error_function_context;
|
||||
static GTY(()) tree last_error_function;
|
||||
static void
|
||||
java_print_error_function (context, file)
|
||||
diagnostic_context *context __attribute__((__unused__));
|
||||
const char *file;
|
||||
java_print_error_function (diagnostic_context *context ATTRIBUTE_UNUSED,
|
||||
const char *file)
|
||||
{
|
||||
/* Don't print error messages with bogus function prototypes. */
|
||||
if (inhibit_error_function_printing)
|
||||
|
@ -796,14 +783,13 @@ java_print_error_function (context, file)
|
|||
2, function prototypes are fully resolved and can be printed when
|
||||
reporting errors. */
|
||||
|
||||
void lang_init_source (level)
|
||||
int level;
|
||||
void lang_init_source (int level)
|
||||
{
|
||||
inhibit_error_function_printing = (level == 1);
|
||||
}
|
||||
|
||||
static void
|
||||
java_init_options ()
|
||||
java_init_options (void)
|
||||
{
|
||||
flag_bounds_check = 1;
|
||||
flag_exceptions = 1;
|
||||
|
@ -814,7 +800,7 @@ java_init_options ()
|
|||
}
|
||||
|
||||
static bool
|
||||
java_can_use_bit_fields_p ()
|
||||
java_can_use_bit_fields_p (void)
|
||||
{
|
||||
/* The bit-field optimizations cause problems when generating class
|
||||
files. */
|
||||
|
@ -823,7 +809,7 @@ java_can_use_bit_fields_p ()
|
|||
|
||||
/* Post-switch processing. */
|
||||
static bool
|
||||
java_post_options ()
|
||||
java_post_options (void)
|
||||
{
|
||||
/* Use tree inlining if possible. Function instrumentation is only
|
||||
done in the RTL level, so we disable tree inlining. */
|
||||
|
@ -845,8 +831,7 @@ java_post_options ()
|
|||
/* Return either DECL or its known constant value (if it has one). */
|
||||
|
||||
tree
|
||||
decl_constant_value (decl)
|
||||
tree decl;
|
||||
decl_constant_value (tree decl)
|
||||
{
|
||||
if (/* Don't change a variable array bound or initial value to a constant
|
||||
in a place where a variable is invalid. */
|
||||
|
@ -868,12 +853,11 @@ decl_constant_value (decl)
|
|||
/* Walk the language specific tree nodes during inlining. */
|
||||
|
||||
static tree
|
||||
java_tree_inlining_walk_subtrees (tp,subtrees,func,data,htab)
|
||||
tree *tp ATTRIBUTE_UNUSED;
|
||||
int *subtrees ATTRIBUTE_UNUSED;
|
||||
walk_tree_fn func ATTRIBUTE_UNUSED;
|
||||
void *data ATTRIBUTE_UNUSED;
|
||||
void *htab ATTRIBUTE_UNUSED;
|
||||
java_tree_inlining_walk_subtrees (tree *tp ATTRIBUTE_UNUSED,
|
||||
int *subtrees ATTRIBUTE_UNUSED,
|
||||
walk_tree_fn func ATTRIBUTE_UNUSED,
|
||||
void *data ATTRIBUTE_UNUSED,
|
||||
void *htab ATTRIBUTE_UNUSED)
|
||||
{
|
||||
enum tree_code code;
|
||||
tree result;
|
||||
|
@ -914,8 +898,7 @@ java_tree_inlining_walk_subtrees (tp,subtrees,func,data,htab)
|
|||
|
||||
/* Called from unsafe_for_reeval. */
|
||||
static int
|
||||
java_unsafe_for_reeval (t)
|
||||
tree t;
|
||||
java_unsafe_for_reeval (tree t)
|
||||
{
|
||||
switch (TREE_CODE (t))
|
||||
{
|
||||
|
@ -961,9 +944,7 @@ java_unsafe_for_reeval (t)
|
|||
to one in the scope of the method being inlined into. */
|
||||
|
||||
static int
|
||||
merge_init_test_initialization (entry, x)
|
||||
void * * entry;
|
||||
void * x;
|
||||
merge_init_test_initialization (void **entry, void *x)
|
||||
{
|
||||
struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry;
|
||||
splay_tree decl_map = (splay_tree)x;
|
||||
|
@ -991,9 +972,7 @@ merge_init_test_initialization (entry, x)
|
|||
inlining. */
|
||||
|
||||
void
|
||||
java_inlining_merge_static_initializers (fn, decl_map)
|
||||
tree fn;
|
||||
void *decl_map;
|
||||
java_inlining_merge_static_initializers (tree fn, void *decl_map)
|
||||
{
|
||||
htab_traverse
|
||||
(DECL_FUNCTION_INIT_TEST_TABLE (fn),
|
||||
|
@ -1007,9 +986,7 @@ java_inlining_merge_static_initializers (fn, decl_map)
|
|||
pre-existing one. */
|
||||
|
||||
static int
|
||||
inline_init_test_initialization (entry, x)
|
||||
void * * entry;
|
||||
void * x;
|
||||
inline_init_test_initialization (void **entry, void *x)
|
||||
{
|
||||
struct treetreehash_entry *ite = (struct treetreehash_entry *) *entry;
|
||||
splay_tree decl_map = (splay_tree)x;
|
||||
|
@ -1032,9 +1009,7 @@ inline_init_test_initialization (entry, x)
|
|||
into, create a new mapping for it. */
|
||||
|
||||
void
|
||||
java_inlining_map_static_initializers (fn, decl_map)
|
||||
tree fn;
|
||||
void *decl_map;
|
||||
java_inlining_map_static_initializers (tree fn, void *decl_map)
|
||||
{
|
||||
htab_traverse
|
||||
(DECL_FUNCTION_INIT_TEST_TABLE (fn),
|
||||
|
@ -1044,9 +1019,7 @@ java_inlining_map_static_initializers (fn, decl_map)
|
|||
/* Avoid voluminous output for deep recursion of compound exprs. */
|
||||
|
||||
static void
|
||||
dump_compound_expr (di, t)
|
||||
dump_info_p di;
|
||||
tree t;
|
||||
dump_compound_expr (dump_info_p di, tree t)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -1072,9 +1045,7 @@ dump_compound_expr (di, t)
|
|||
}
|
||||
|
||||
static int
|
||||
java_dump_tree (dump_info, t)
|
||||
void *dump_info;
|
||||
tree t;
|
||||
java_dump_tree (void *dump_info, tree t)
|
||||
{
|
||||
enum tree_code code;
|
||||
dump_info_p di = (dump_info_p) dump_info;
|
||||
|
|
|
@ -82,9 +82,7 @@ static int need_byteswap = 0;
|
|||
#endif
|
||||
|
||||
void
|
||||
java_init_lex (finput, encoding)
|
||||
FILE *finput;
|
||||
const char *encoding;
|
||||
java_init_lex (FILE *finput, const char *encoding)
|
||||
{
|
||||
#ifndef JC1_LITE
|
||||
int java_lang_imported = 0;
|
||||
|
@ -139,9 +137,7 @@ java_init_lex (finput, encoding)
|
|||
}
|
||||
|
||||
static char *
|
||||
java_sprint_unicode (line, i)
|
||||
struct java_line *line;
|
||||
int i;
|
||||
java_sprint_unicode (struct java_line *line, int i)
|
||||
{
|
||||
static char buffer [10];
|
||||
if (line->unicode_escape_p [i] || line->line [i] > 128)
|
||||
|
@ -155,13 +151,13 @@ java_sprint_unicode (line, i)
|
|||
}
|
||||
|
||||
static unicode_t
|
||||
java_sneak_unicode ()
|
||||
java_sneak_unicode (void)
|
||||
{
|
||||
return (ctxp->c_line->line [ctxp->c_line->current]);
|
||||
}
|
||||
|
||||
static void
|
||||
java_unget_unicode ()
|
||||
java_unget_unicode (void)
|
||||
{
|
||||
if (!ctxp->c_line->current)
|
||||
/* Can't unget unicode. */
|
||||
|
@ -172,7 +168,7 @@ java_unget_unicode ()
|
|||
}
|
||||
|
||||
static void
|
||||
java_allocate_new_line ()
|
||||
java_allocate_new_line (void)
|
||||
{
|
||||
unicode_t ahead = (ctxp->c_line ? ctxp->c_line->ahead[0] : '\0');
|
||||
char ahead_escape_p = (ctxp->c_line ?
|
||||
|
@ -217,9 +213,7 @@ java_allocate_new_line ()
|
|||
/* Create a new lexer object. */
|
||||
|
||||
java_lexer *
|
||||
java_new_lexer (finput, encoding)
|
||||
FILE *finput;
|
||||
const char *encoding;
|
||||
java_new_lexer (FILE *finput, const char *encoding)
|
||||
{
|
||||
java_lexer *lex = xmalloc (sizeof (java_lexer));
|
||||
int enc_error = 0;
|
||||
|
@ -306,8 +300,7 @@ java_new_lexer (finput, encoding)
|
|||
}
|
||||
|
||||
void
|
||||
java_destroy_lexer (lex)
|
||||
java_lexer *lex;
|
||||
java_destroy_lexer (java_lexer *lex)
|
||||
{
|
||||
#ifdef HAVE_ICONV
|
||||
if (! lex->use_fallback)
|
||||
|
@ -317,8 +310,7 @@ java_destroy_lexer (lex)
|
|||
}
|
||||
|
||||
static int
|
||||
java_read_char (lex)
|
||||
java_lexer *lex;
|
||||
java_read_char (java_lexer *lex)
|
||||
{
|
||||
if (lex->unget_value)
|
||||
{
|
||||
|
@ -509,10 +501,7 @@ java_read_char (lex)
|
|||
}
|
||||
|
||||
static void
|
||||
java_store_unicode (l, c, unicode_escape_p)
|
||||
struct java_line *l;
|
||||
unicode_t c;
|
||||
int unicode_escape_p;
|
||||
java_store_unicode (struct java_line *l, unicode_t c, int unicode_escape_p)
|
||||
{
|
||||
if (l->size == l->max)
|
||||
{
|
||||
|
@ -526,9 +515,7 @@ java_store_unicode (l, c, unicode_escape_p)
|
|||
}
|
||||
|
||||
static int
|
||||
java_read_unicode (lex, unicode_escape_p)
|
||||
java_lexer *lex;
|
||||
int *unicode_escape_p;
|
||||
java_read_unicode (java_lexer *lex, int *unicode_escape_p)
|
||||
{
|
||||
int c;
|
||||
|
||||
|
@ -582,9 +569,8 @@ java_read_unicode (lex, unicode_escape_p)
|
|||
}
|
||||
|
||||
static int
|
||||
java_read_unicode_collapsing_terminators (lex, unicode_escape_p)
|
||||
java_lexer *lex;
|
||||
int *unicode_escape_p;
|
||||
java_read_unicode_collapsing_terminators (java_lexer *lex,
|
||||
int *unicode_escape_p)
|
||||
{
|
||||
int c = java_read_unicode (lex, unicode_escape_p);
|
||||
|
||||
|
@ -604,7 +590,7 @@ java_read_unicode_collapsing_terminators (lex, unicode_escape_p)
|
|||
}
|
||||
|
||||
static int
|
||||
java_get_unicode ()
|
||||
java_get_unicode (void)
|
||||
{
|
||||
/* It's time to read a line when... */
|
||||
if (!ctxp->c_line || ctxp->c_line->current == ctxp->c_line->size)
|
||||
|
@ -651,8 +637,7 @@ java_get_unicode ()
|
|||
/* Parse the end of a C style comment.
|
||||
* C is the first character following the '/' and '*'. */
|
||||
static void
|
||||
java_parse_end_comment (c)
|
||||
int c;
|
||||
java_parse_end_comment (int c)
|
||||
{
|
||||
for ( ;; c = java_get_unicode ())
|
||||
{
|
||||
|
@ -681,8 +666,7 @@ java_parse_end_comment (c)
|
|||
character). Parsed keyword(s): @DEPRECATED. */
|
||||
|
||||
static int
|
||||
java_parse_doc_section (c)
|
||||
int c;
|
||||
java_parse_doc_section (int c)
|
||||
{
|
||||
int valid_tag = 0, seen_star = 0;
|
||||
|
||||
|
@ -734,8 +718,7 @@ java_parse_doc_section (c)
|
|||
This is only called if C >= 128 -- smaller values are handled
|
||||
inline. However, this function handles all values anyway. */
|
||||
static int
|
||||
java_start_char_p (c)
|
||||
unicode_t c;
|
||||
java_start_char_p (unicode_t c)
|
||||
{
|
||||
unsigned int hi = c / 256;
|
||||
const char *const page = type_table[hi];
|
||||
|
@ -754,8 +737,7 @@ java_start_char_p (c)
|
|||
This is only called if C >= 128 -- smaller values are handled
|
||||
inline. However, this function handles all values anyway. */
|
||||
static int
|
||||
java_part_char_p (c)
|
||||
unicode_t c;
|
||||
java_part_char_p (unicode_t c)
|
||||
{
|
||||
unsigned int hi = c / 256;
|
||||
const char *const page = type_table[hi];
|
||||
|
@ -771,7 +753,7 @@ java_part_char_p (c)
|
|||
}
|
||||
|
||||
static int
|
||||
java_parse_escape_sequence ()
|
||||
java_parse_escape_sequence (void)
|
||||
{
|
||||
unicode_t char_lit;
|
||||
int c;
|
||||
|
@ -840,11 +822,8 @@ java_parse_escape_sequence ()
|
|||
static void java_perform_atof (YYSTYPE *, char *, int, int);
|
||||
|
||||
static void
|
||||
java_perform_atof (java_lval, literal_token, fflag, number_beginning)
|
||||
YYSTYPE *java_lval;
|
||||
char *literal_token;
|
||||
int fflag;
|
||||
int number_beginning;
|
||||
java_perform_atof (YYSTYPE *java_lval, char *literal_token, int fflag,
|
||||
int number_beginning)
|
||||
{
|
||||
REAL_VALUE_TYPE value;
|
||||
tree type = (fflag ? FLOAT_TYPE_NODE : DOUBLE_TYPE_NODE);
|
||||
|
@ -891,11 +870,10 @@ static int yylex (YYSTYPE *);
|
|||
|
||||
static int
|
||||
#ifdef JC1_LITE
|
||||
yylex (java_lval)
|
||||
yylex (YYSTYPE *java_lval)
|
||||
#else
|
||||
java_lex (java_lval)
|
||||
java_lex (YYSTYPE *java_lval)
|
||||
#endif
|
||||
YYSTYPE *java_lval;
|
||||
{
|
||||
int c;
|
||||
unicode_t first_unicode;
|
||||
|
@ -1654,8 +1632,7 @@ java_lex (java_lval)
|
|||
case of the largest negative value, and is only called in the case
|
||||
where this value is not preceded by `-'. */
|
||||
static void
|
||||
error_if_numeric_overflow (value)
|
||||
tree value;
|
||||
error_if_numeric_overflow (tree value)
|
||||
{
|
||||
if (TREE_CODE (value) == INTEGER_CST
|
||||
&& JAVA_RADIX10_FLAG (value)
|
||||
|
@ -1670,8 +1647,7 @@ error_if_numeric_overflow (value)
|
|||
#endif /* JC1_LITE */
|
||||
|
||||
static void
|
||||
java_unicode_2_utf8 (unicode)
|
||||
unicode_t unicode;
|
||||
java_unicode_2_utf8 (unicode_t unicode)
|
||||
{
|
||||
if (RANGE (unicode, 0x01, 0x7f))
|
||||
obstack_1grow (&temporary_obstack, (char)unicode);
|
||||
|
@ -1695,8 +1671,7 @@ java_unicode_2_utf8 (unicode)
|
|||
|
||||
#ifndef JC1_LITE
|
||||
static tree
|
||||
build_wfl_node (node)
|
||||
tree node;
|
||||
build_wfl_node (tree node)
|
||||
{
|
||||
node = build_expr_wfl (node, ctxp->filename, ctxp->elc.line, ctxp->elc.col);
|
||||
/* Prevent java_complete_lhs from short-circuiting node (if constant). */
|
||||
|
@ -1706,9 +1681,7 @@ build_wfl_node (node)
|
|||
#endif
|
||||
|
||||
static void
|
||||
java_lex_error (msg, forward)
|
||||
const char *msg ATTRIBUTE_UNUSED;
|
||||
int forward ATTRIBUTE_UNUSED;
|
||||
java_lex_error (const char *msg ATTRIBUTE_UNUSED, int forward ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifndef JC1_LITE
|
||||
ctxp->elc.line = ctxp->c_line->lineno;
|
||||
|
@ -1723,9 +1696,7 @@ java_lex_error (msg, forward)
|
|||
|
||||
#ifndef JC1_LITE
|
||||
static int
|
||||
java_is_eol (fp, c)
|
||||
FILE *fp;
|
||||
int c;
|
||||
java_is_eol (FILE *fp, int c)
|
||||
{
|
||||
int next;
|
||||
switch (c)
|
||||
|
@ -1744,9 +1715,8 @@ java_is_eol (fp, c)
|
|||
#endif
|
||||
|
||||
char *
|
||||
java_get_line_col (filename, line, col)
|
||||
const char *filename ATTRIBUTE_UNUSED;
|
||||
int line ATTRIBUTE_UNUSED, col ATTRIBUTE_UNUSED;
|
||||
java_get_line_col (const char *filename ATTRIBUTE_UNUSED,
|
||||
int line ATTRIBUTE_UNUSED, int col ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef JC1_LITE
|
||||
return 0;
|
||||
|
@ -1822,10 +1792,7 @@ java_get_line_col (filename, line, col)
|
|||
|
||||
#ifndef JC1_LITE
|
||||
static int
|
||||
utf8_cmp (str, length, name)
|
||||
const unsigned char *str;
|
||||
int length;
|
||||
const char *name;
|
||||
utf8_cmp (const unsigned char *str, int length, const char *name)
|
||||
{
|
||||
const unsigned char *limit = str + length;
|
||||
int i;
|
||||
|
@ -1953,9 +1920,7 @@ static const char *const cxx_keywords[] =
|
|||
/* Return true if NAME is a C++ keyword. */
|
||||
|
||||
int
|
||||
cxx_keyword_p (name, length)
|
||||
const char *name;
|
||||
int length;
|
||||
cxx_keyword_p (const char *name, int length)
|
||||
{
|
||||
int last = ARRAY_SIZE (cxx_keywords);
|
||||
int first = 0;
|
||||
|
|
|
@ -71,9 +71,7 @@ struct obstack *mangle_obstack;
|
|||
the vtable. */
|
||||
|
||||
tree
|
||||
java_mangle_decl (obstack, decl)
|
||||
struct obstack *obstack;
|
||||
tree decl;
|
||||
java_mangle_decl (struct obstack *obstack, tree decl)
|
||||
{
|
||||
init_mangling (obstack);
|
||||
switch (TREE_CODE (decl))
|
||||
|
@ -91,9 +89,7 @@ java_mangle_decl (obstack, decl)
|
|||
}
|
||||
|
||||
tree
|
||||
java_mangle_class_field (obstack, type)
|
||||
struct obstack *obstack;
|
||||
tree type;
|
||||
java_mangle_class_field (struct obstack *obstack, tree type)
|
||||
{
|
||||
init_mangling (obstack);
|
||||
mangle_record_type (type, /* for_pointer = */ 0);
|
||||
|
@ -103,9 +99,7 @@ java_mangle_class_field (obstack, type)
|
|||
}
|
||||
|
||||
tree
|
||||
java_mangle_vtable (obstack, type)
|
||||
struct obstack *obstack;
|
||||
tree type;
|
||||
java_mangle_vtable (struct obstack *obstack, tree type)
|
||||
{
|
||||
init_mangling (obstack);
|
||||
MANGLE_RAW_STRING ("TV");
|
||||
|
@ -119,8 +113,7 @@ java_mangle_vtable (obstack, type)
|
|||
/* This mangles a field decl */
|
||||
|
||||
static void
|
||||
mangle_field_decl (decl)
|
||||
tree decl;
|
||||
mangle_field_decl (tree decl)
|
||||
{
|
||||
/* Mangle the name of the this the field belongs to */
|
||||
mangle_record_type (DECL_CONTEXT (decl), /* for_pointer = */ 0);
|
||||
|
@ -136,8 +129,7 @@ mangle_field_decl (decl)
|
|||
its arguments. */
|
||||
|
||||
static void
|
||||
mangle_method_decl (mdecl)
|
||||
tree mdecl;
|
||||
mangle_method_decl (tree mdecl)
|
||||
{
|
||||
tree method_name = DECL_NAME (mdecl);
|
||||
tree arglist;
|
||||
|
@ -177,8 +169,7 @@ mangle_method_decl (mdecl)
|
|||
value if unicode encoding was required. */
|
||||
|
||||
static void
|
||||
mangle_member_name (name)
|
||||
tree name;
|
||||
mangle_member_name (tree name)
|
||||
{
|
||||
append_gpp_mangled_name (IDENTIFIER_POINTER (name),
|
||||
IDENTIFIER_LENGTH (name));
|
||||
|
@ -191,8 +182,7 @@ mangle_member_name (name)
|
|||
/* Append the mangled name of TYPE onto OBSTACK. */
|
||||
|
||||
static void
|
||||
mangle_type (type)
|
||||
tree type;
|
||||
mangle_type (tree type)
|
||||
{
|
||||
switch (TREE_CODE (type))
|
||||
{
|
||||
|
@ -255,8 +245,7 @@ static int compression_next;
|
|||
function to match pointer entries and start from the end */
|
||||
|
||||
static int
|
||||
find_compression_pointer_match (type)
|
||||
tree type;
|
||||
find_compression_pointer_match (tree type)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -270,8 +259,7 @@ find_compression_pointer_match (type)
|
|||
associated with it. */
|
||||
|
||||
static int
|
||||
find_compression_array_match (type)
|
||||
tree type;
|
||||
find_compression_array_match (tree type)
|
||||
{
|
||||
return find_compression_pointer_match (type);
|
||||
}
|
||||
|
@ -279,8 +267,7 @@ find_compression_array_match (type)
|
|||
/* Match the table of type against STRING. */
|
||||
|
||||
static int
|
||||
find_compression_array_template_match (string)
|
||||
tree string;
|
||||
find_compression_array_template_match (tree string)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < compression_next; i++)
|
||||
|
@ -295,9 +282,7 @@ find_compression_array_template_match (string)
|
|||
to the rest of TYPE to be mangled. */
|
||||
|
||||
static int
|
||||
find_compression_record_match (type, next_current)
|
||||
tree type;
|
||||
tree *next_current;
|
||||
find_compression_record_match (tree type, tree *next_current)
|
||||
{
|
||||
int i, match;
|
||||
tree current, saved_current = NULL_TREE;
|
||||
|
@ -349,9 +334,7 @@ find_compression_record_match (type, next_current)
|
|||
symbol, meaning it was preceded by a 'P'. */
|
||||
|
||||
static int
|
||||
mangle_record_type (type, for_pointer)
|
||||
tree type;
|
||||
int for_pointer;
|
||||
mangle_record_type (tree type, int for_pointer)
|
||||
{
|
||||
tree current;
|
||||
int match;
|
||||
|
@ -402,8 +385,7 @@ mangle_record_type (type, for_pointer)
|
|||
a partial compression or/plus the rest of the mangling. */
|
||||
|
||||
static void
|
||||
mangle_pointer_type (type)
|
||||
tree type;
|
||||
mangle_pointer_type (tree type)
|
||||
{
|
||||
int match;
|
||||
tree pointer_type;
|
||||
|
@ -437,8 +419,7 @@ mangle_pointer_type (type)
|
|||
/* atms: array template mangled string. */
|
||||
static GTY(()) tree atms;
|
||||
static void
|
||||
mangle_array_type (p_type)
|
||||
tree p_type;
|
||||
mangle_array_type (tree p_type)
|
||||
{
|
||||
tree type, elt_type;
|
||||
int match;
|
||||
|
@ -526,9 +507,7 @@ emit_compression_string (int i)
|
|||
might all be unique, we find the same RECORD_TYPE.) */
|
||||
|
||||
static int
|
||||
entry_match_pointer_p (type, i)
|
||||
tree type;
|
||||
int i;
|
||||
entry_match_pointer_p (tree type, int i)
|
||||
{
|
||||
tree t = TREE_VEC_ELT (compression_table, i);
|
||||
|
||||
|
@ -549,8 +528,7 @@ entry_match_pointer_p (type, i)
|
|||
part. The result is stored in TYPE_PACKAGE_LIST to be reused. */
|
||||
|
||||
static void
|
||||
set_type_package_list (type)
|
||||
tree type;
|
||||
set_type_package_list (tree type)
|
||||
{
|
||||
int i;
|
||||
const char *type_string = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
|
||||
|
@ -593,8 +571,7 @@ set_type_package_list (type)
|
|||
compression table if necessary. */
|
||||
|
||||
static void
|
||||
compression_table_add (type)
|
||||
tree type;
|
||||
compression_table_add (tree type)
|
||||
{
|
||||
if (compression_next == TREE_VEC_LENGTH (compression_table))
|
||||
{
|
||||
|
@ -612,8 +589,7 @@ compression_table_add (type)
|
|||
/* Mangling initialization routine. */
|
||||
|
||||
static void
|
||||
init_mangling (obstack)
|
||||
struct obstack *obstack;
|
||||
init_mangling (struct obstack *obstack)
|
||||
{
|
||||
mangle_obstack = obstack;
|
||||
if (!compression_table)
|
||||
|
@ -630,7 +606,7 @@ init_mangling (obstack)
|
|||
IDENTIFIER_NODE. */
|
||||
|
||||
static tree
|
||||
finish_mangling ()
|
||||
finish_mangling (void)
|
||||
{
|
||||
tree result;
|
||||
|
||||
|
|
|
@ -53,9 +53,7 @@ extern struct obstack *mangle_obstack;
|
|||
frequently that they could be cached. */
|
||||
|
||||
void
|
||||
append_gpp_mangled_name (name, len)
|
||||
const char *name;
|
||||
int len;
|
||||
append_gpp_mangled_name (const char *name, int len)
|
||||
{
|
||||
int encoded_len = unicode_mangling_length (name, len);
|
||||
int needs_escapes = encoded_len > 0;
|
||||
|
@ -76,9 +74,7 @@ append_gpp_mangled_name (name, len)
|
|||
which case `__U' will be mangled `__U_'. */
|
||||
|
||||
static void
|
||||
append_unicode_mangled_name (name, len)
|
||||
const char *name;
|
||||
int len;
|
||||
append_unicode_mangled_name (const char *name, int len)
|
||||
{
|
||||
const unsigned char *ptr;
|
||||
const unsigned char *limit = (const unsigned char *)name + len;
|
||||
|
@ -129,9 +125,7 @@ append_unicode_mangled_name (name, len)
|
|||
escapes. If no escapes are needed, return 0. */
|
||||
|
||||
static int
|
||||
unicode_mangling_length (name, len)
|
||||
const char *name;
|
||||
int len;
|
||||
unicode_mangling_length (const char *name, int len)
|
||||
{
|
||||
const unsigned char *ptr;
|
||||
const unsigned char *limit = (const unsigned char *)name + len;
|
||||
|
@ -199,9 +193,7 @@ unicode_mangling_length (name, len)
|
|||
so frequently that they could be cached. */
|
||||
|
||||
void
|
||||
append_gpp_mangled_name (name, len)
|
||||
const char *name;
|
||||
int len;
|
||||
append_gpp_mangled_name (const char *name, int len)
|
||||
{
|
||||
const unsigned char *ptr;
|
||||
const unsigned char *limit = (const unsigned char *)name + len;
|
||||
|
|
|
@ -1176,7 +1176,7 @@ constant_expression:
|
|||
/* Create a new parser context */
|
||||
|
||||
void
|
||||
java_push_parser_context ()
|
||||
java_push_parser_context (void)
|
||||
{
|
||||
struct parser_ctxt *new = xcalloc (1, sizeof (struct parser_ctxt));
|
||||
|
||||
|
@ -1185,8 +1185,7 @@ java_push_parser_context ()
|
|||
}
|
||||
|
||||
static void
|
||||
push_class_context (name)
|
||||
const char *name;
|
||||
push_class_context (const char *name)
|
||||
{
|
||||
struct class_context *ctx;
|
||||
|
||||
|
@ -1197,7 +1196,7 @@ push_class_context (name)
|
|||
}
|
||||
|
||||
static void
|
||||
pop_class_context ()
|
||||
pop_class_context (void)
|
||||
{
|
||||
struct class_context *ctx;
|
||||
|
||||
|
@ -1217,9 +1216,7 @@ pop_class_context ()
|
|||
/* Recursively construct the class name. This is just a helper
|
||||
function for get_class_name(). */
|
||||
static int
|
||||
make_class_name_recursive (stack, ctx)
|
||||
struct obstack *stack;
|
||||
struct class_context *ctx;
|
||||
make_class_name_recursive (struct obstack *stack, struct class_context *ctx)
|
||||
{
|
||||
if (! ctx)
|
||||
return 0;
|
||||
|
@ -1243,7 +1240,7 @@ make_class_name_recursive (stack, ctx)
|
|||
|
||||
/* Return a newly allocated string holding the name of the class. */
|
||||
static char *
|
||||
get_class_name ()
|
||||
get_class_name (void)
|
||||
{
|
||||
char *result;
|
||||
int last_was_digit;
|
||||
|
@ -1287,8 +1284,7 @@ get_class_name ()
|
|||
/* Actions defined here */
|
||||
|
||||
static void
|
||||
report_class_declaration (name)
|
||||
const char * name;
|
||||
report_class_declaration (const char * name)
|
||||
{
|
||||
extern int flag_dump_class, flag_list_filename;
|
||||
|
||||
|
@ -1314,8 +1310,7 @@ report_class_declaration (name)
|
|||
}
|
||||
|
||||
static void
|
||||
report_main_declaration (declarator)
|
||||
struct method_declarator *declarator;
|
||||
report_main_declaration (struct method_declarator *declarator)
|
||||
{
|
||||
extern int flag_find_main;
|
||||
|
||||
|
@ -1342,7 +1337,7 @@ report_main_declaration (declarator)
|
|||
}
|
||||
|
||||
void
|
||||
report ()
|
||||
report (void)
|
||||
{
|
||||
extern int flag_complexity;
|
||||
if (flag_complexity)
|
||||
|
@ -1351,7 +1346,7 @@ report ()
|
|||
|
||||
/* Reset global status used by the report functions. */
|
||||
|
||||
void reset_report ()
|
||||
void reset_report (void)
|
||||
{
|
||||
previous_output = 0;
|
||||
package_name = NULL;
|
||||
|
@ -1360,8 +1355,7 @@ void reset_report ()
|
|||
}
|
||||
|
||||
void
|
||||
yyerror (msg)
|
||||
const char *msg ATTRIBUTE_UNUSED;
|
||||
yyerror (const char *msg ATTRIBUTE_UNUSED)
|
||||
{
|
||||
fprintf (stderr, "%s: %d: %s\n", input_filename, lineno, msg);
|
||||
exit (1);
|
||||
|
|
880
gcc/java/parse.y
880
gcc/java/parse.y
File diff suppressed because it is too large
Load Diff
|
@ -50,9 +50,7 @@ tree * type_map;
|
|||
/* Set the type of the local variable with index SLOT to TYPE. */
|
||||
|
||||
void
|
||||
set_local_type (slot, type)
|
||||
int slot;
|
||||
tree type;
|
||||
set_local_type (int slot, tree type)
|
||||
{
|
||||
int max_locals = DECL_MAX_LOCALS(current_function_decl);
|
||||
int nslots = TYPE_IS_WIDE (type) ? 2 : 1;
|
||||
|
@ -80,8 +78,7 @@ set_local_type (slot, type)
|
|||
: (int)expr))) */
|
||||
|
||||
static tree
|
||||
convert_ieee_real_to_integer (type, expr)
|
||||
tree type, expr;
|
||||
convert_ieee_real_to_integer (tree type, tree expr)
|
||||
{
|
||||
tree result;
|
||||
expr = save_expr (expr);
|
||||
|
@ -113,8 +110,7 @@ convert_ieee_real_to_integer (type, expr)
|
|||
not permitted by the language being compiled. */
|
||||
|
||||
tree
|
||||
convert (type, expr)
|
||||
tree type, expr;
|
||||
convert (tree type, tree expr)
|
||||
{
|
||||
register enum tree_code code = TREE_CODE (type);
|
||||
|
||||
|
@ -155,15 +151,13 @@ convert (type, expr)
|
|||
|
||||
|
||||
tree
|
||||
convert_to_char (type, expr)
|
||||
tree type, expr;
|
||||
convert_to_char (tree type, tree expr)
|
||||
{
|
||||
return build1 (NOP_EXPR, type, expr);
|
||||
}
|
||||
|
||||
tree
|
||||
convert_to_boolean (type, expr)
|
||||
tree type, expr;
|
||||
convert_to_boolean (tree type, tree expr)
|
||||
{
|
||||
return build1 (NOP_EXPR, type, expr);
|
||||
}
|
||||
|
@ -173,9 +167,7 @@ convert_to_boolean (type, expr)
|
|||
then UNSIGNEDP selects between signed and unsigned types. */
|
||||
|
||||
tree
|
||||
java_type_for_mode (mode, unsignedp)
|
||||
enum machine_mode mode;
|
||||
int unsignedp;
|
||||
java_type_for_mode (enum machine_mode mode, int unsignedp)
|
||||
{
|
||||
if (mode == TYPE_MODE (int_type_node))
|
||||
return unsignedp ? unsigned_int_type_node : int_type_node;
|
||||
|
@ -197,9 +189,7 @@ java_type_for_mode (mode, unsignedp)
|
|||
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */
|
||||
|
||||
tree
|
||||
java_type_for_size (bits, unsignedp)
|
||||
unsigned bits;
|
||||
int unsignedp;
|
||||
java_type_for_size (unsigned bits, int unsignedp)
|
||||
{
|
||||
if (bits <= TYPE_PRECISION (byte_type_node))
|
||||
return unsignedp ? unsigned_byte_type_node : byte_type_node;
|
||||
|
@ -216,9 +206,7 @@ java_type_for_size (bits, unsignedp)
|
|||
signed according to UNSIGNEDP. */
|
||||
|
||||
tree
|
||||
java_signed_or_unsigned_type (unsignedp, type)
|
||||
int unsignedp;
|
||||
tree type;
|
||||
java_signed_or_unsigned_type (int unsignedp, tree type)
|
||||
{
|
||||
if (! INTEGRAL_TYPE_P (type))
|
||||
return type;
|
||||
|
@ -236,8 +224,7 @@ java_signed_or_unsigned_type (unsignedp, type)
|
|||
/* Return a signed type the same as TYPE in other respects. */
|
||||
|
||||
tree
|
||||
java_signed_type (type)
|
||||
tree type;
|
||||
java_signed_type (tree type)
|
||||
{
|
||||
return java_signed_or_unsigned_type (0, type);
|
||||
}
|
||||
|
@ -245,8 +232,7 @@ java_signed_type (type)
|
|||
/* Return an unsigned type the same as TYPE in other respects. */
|
||||
|
||||
tree
|
||||
java_unsigned_type (type)
|
||||
tree type;
|
||||
java_unsigned_type (tree type)
|
||||
{
|
||||
return java_signed_or_unsigned_type (1, type);
|
||||
}
|
||||
|
@ -256,8 +242,7 @@ java_unsigned_type (type)
|
|||
Value is true if successful. */
|
||||
|
||||
bool
|
||||
java_mark_addressable (exp)
|
||||
tree exp;
|
||||
java_mark_addressable (tree exp)
|
||||
{
|
||||
register tree x = exp;
|
||||
while (1)
|
||||
|
@ -320,8 +305,7 @@ java_mark_addressable (exp)
|
|||
/* Thorough checking of the arrayness of TYPE. */
|
||||
|
||||
int
|
||||
is_array_type_p (type)
|
||||
tree type;
|
||||
is_array_type_p (tree type)
|
||||
{
|
||||
return TREE_CODE (type) == POINTER_TYPE
|
||||
&& TREE_CODE (TREE_TYPE (type)) == RECORD_TYPE
|
||||
|
@ -332,8 +316,7 @@ is_array_type_p (type)
|
|||
Return -1 if the length is unknown or non-constant. */
|
||||
|
||||
HOST_WIDE_INT
|
||||
java_array_type_length (array_type)
|
||||
tree array_type;
|
||||
java_array_type_length (tree array_type)
|
||||
{
|
||||
tree arfld;
|
||||
if (TREE_CODE (array_type) == POINTER_TYPE)
|
||||
|
@ -358,9 +341,7 @@ java_array_type_length (array_type)
|
|||
`length' from static arrays. We could restore it, FIXME. */
|
||||
|
||||
tree
|
||||
build_prim_array_type (element_type, length)
|
||||
tree element_type;
|
||||
HOST_WIDE_INT length;
|
||||
build_prim_array_type (tree element_type, HOST_WIDE_INT length)
|
||||
{
|
||||
tree index = NULL;
|
||||
|
||||
|
@ -378,9 +359,7 @@ build_prim_array_type (element_type, length)
|
|||
The LENGTH is -1 if the length is unknown. */
|
||||
|
||||
tree
|
||||
build_java_array_type (element_type, length)
|
||||
tree element_type;
|
||||
HOST_WIDE_INT length;
|
||||
build_java_array_type (tree element_type, HOST_WIDE_INT length)
|
||||
{
|
||||
tree sig, t, fld, atype, arfld;
|
||||
char buf[12];
|
||||
|
@ -441,8 +420,7 @@ build_java_array_type (element_type, length)
|
|||
/* Promote TYPE to the type actually used for fields and parameters. */
|
||||
|
||||
tree
|
||||
promote_type (type)
|
||||
tree type;
|
||||
promote_type (tree type)
|
||||
{
|
||||
switch (TREE_CODE (type))
|
||||
{
|
||||
|
@ -476,8 +454,7 @@ promote_type (type)
|
|||
Return the seen TREE_TYPE, updating *PTR. */
|
||||
|
||||
static tree
|
||||
parse_signature_type (ptr, limit)
|
||||
const unsigned char **ptr, *limit;
|
||||
parse_signature_type (const unsigned char **ptr, const unsigned char *limit)
|
||||
{
|
||||
tree type;
|
||||
|
||||
|
@ -526,9 +503,7 @@ parse_signature_type (ptr, limit)
|
|||
Return a gcc type node. */
|
||||
|
||||
tree
|
||||
parse_signature_string (sig_string, sig_length)
|
||||
const unsigned char *sig_string;
|
||||
int sig_length;
|
||||
parse_signature_string (const unsigned char *sig_string, int sig_length)
|
||||
{
|
||||
tree result_type;
|
||||
const unsigned char *str = sig_string;
|
||||
|
@ -581,8 +556,7 @@ get_type_from_signature (tree signature)
|
|||
/* Ignore signature and always return null. Used by has_method. */
|
||||
|
||||
static tree
|
||||
build_null_signature (type)
|
||||
tree type ATTRIBUTE_UNUSED;
|
||||
build_null_signature (tree type ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
@ -590,8 +564,7 @@ build_null_signature (type)
|
|||
/* Return the signature string for the arguments of method type TYPE. */
|
||||
|
||||
tree
|
||||
build_java_argument_signature (type)
|
||||
tree type;
|
||||
build_java_argument_signature (tree type)
|
||||
{
|
||||
extern struct obstack temporary_obstack;
|
||||
tree sig = TYPE_ARGUMENT_SIGNATURE (type);
|
||||
|
@ -618,8 +591,7 @@ build_java_argument_signature (type)
|
|||
/* Return the signature of the given TYPE. */
|
||||
|
||||
tree
|
||||
build_java_signature (type)
|
||||
tree type;
|
||||
build_java_signature (tree type)
|
||||
{
|
||||
tree sig, t;
|
||||
while (TREE_CODE (type) == POINTER_TYPE)
|
||||
|
@ -699,9 +671,7 @@ build_java_signature (type)
|
|||
/* Save signature string SIG (an IDENTIFIER_NODE) in TYPE for future use. */
|
||||
|
||||
void
|
||||
set_java_signature (type, sig)
|
||||
tree type;
|
||||
tree sig;
|
||||
set_java_signature (tree type, tree sig)
|
||||
{
|
||||
tree old_sig;
|
||||
while (TREE_CODE (type) == POINTER_TYPE)
|
||||
|
@ -725,8 +695,7 @@ set_java_signature (type, sig)
|
|||
signature. */
|
||||
|
||||
tree
|
||||
lookup_argument_method (searched_class, method_name, method_signature)
|
||||
tree searched_class, method_name, method_signature;
|
||||
lookup_argument_method (tree searched_class, tree method_name, tree method_signature)
|
||||
{
|
||||
return lookup_do (searched_class, NULL_TREE, method_name, method_signature,
|
||||
build_java_argument_signature);
|
||||
|
@ -739,8 +708,7 @@ lookup_argument_method (searched_class, method_name, method_signature)
|
|||
which takes into account return type.) */
|
||||
|
||||
tree
|
||||
lookup_argument_method2 (searched_class, method_name, method_signature)
|
||||
tree searched_class, method_name, method_signature;
|
||||
lookup_argument_method2 (tree searched_class, tree method_name, tree method_signature)
|
||||
{
|
||||
return lookup_do (CLASSTYPE_SUPER (searched_class), searched_class,
|
||||
method_name, method_signature,
|
||||
|
@ -754,8 +722,7 @@ lookup_argument_method2 (searched_class, method_name, method_signature)
|
|||
SEARCHED_CLASS is an interface, search it too. */
|
||||
|
||||
tree
|
||||
lookup_java_method (searched_class, method_name, method_signature)
|
||||
tree searched_class, method_name, method_signature;
|
||||
lookup_java_method (tree searched_class, tree method_name, tree method_signature)
|
||||
{
|
||||
tree searched_interface;
|
||||
|
||||
|
@ -772,9 +739,7 @@ lookup_java_method (searched_class, method_name, method_signature)
|
|||
/* Return true iff CLASS (or its ancestors) has a method METHOD_NAME. */
|
||||
|
||||
int
|
||||
has_method (class, method_name)
|
||||
tree class;
|
||||
tree method_name;
|
||||
has_method (tree class, tree method_name)
|
||||
{
|
||||
return lookup_do (class, class, method_name,
|
||||
NULL_TREE, build_null_signature) != NULL_TREE;
|
||||
|
@ -788,9 +753,8 @@ has_method (class, method_name)
|
|||
signature. */
|
||||
|
||||
static tree
|
||||
lookup_do (searched_class, searched_interface, method_name, signature, signature_builder)
|
||||
tree searched_class, searched_interface, method_name, signature;
|
||||
tree (*signature_builder) (tree);
|
||||
lookup_do (tree searched_class, tree searched_interface, tree method_name,
|
||||
tree signature, tree (*signature_builder) (tree))
|
||||
{
|
||||
tree method;
|
||||
|
||||
|
@ -851,8 +815,7 @@ lookup_do (searched_class, searched_interface, method_name, signature, signature
|
|||
Return a FUNCTION_DECL on success, or NULL_TREE if none found. */
|
||||
|
||||
tree
|
||||
lookup_java_constructor (clas, method_signature)
|
||||
tree clas, method_signature;
|
||||
lookup_java_constructor (tree clas, tree method_signature)
|
||||
{
|
||||
tree method = TYPE_METHODS (clas);
|
||||
for ( ; method != NULL_TREE; method = TREE_CHAIN (method))
|
||||
|
@ -869,11 +832,7 @@ lookup_java_constructor (clas, method_signature)
|
|||
Promotion. It assumes that both T1 and T2 are eligible to BNP. */
|
||||
|
||||
tree
|
||||
binary_numeric_promotion (t1, t2, exp1, exp2)
|
||||
tree t1;
|
||||
tree t2;
|
||||
tree *exp1;
|
||||
tree *exp2;
|
||||
binary_numeric_promotion (tree t1, tree t2, tree *exp1, tree *exp2)
|
||||
{
|
||||
if (t1 == double_type_node || t2 == double_type_node)
|
||||
{
|
||||
|
|
|
@ -56,8 +56,7 @@ tree pending_blocks;
|
|||
/* Append TARGET_LABEL to the pending_block stack unless already in it. */
|
||||
|
||||
static void
|
||||
push_pending_label (target_label)
|
||||
tree target_label;
|
||||
push_pending_label (tree target_label)
|
||||
{
|
||||
if (! LABEL_CHANGED (target_label))
|
||||
{
|
||||
|
@ -72,8 +71,7 @@ push_pending_label (target_label)
|
|||
Return NULL on success, or an error message on failure. */
|
||||
|
||||
static const char *
|
||||
check_pending_block (target_label)
|
||||
tree target_label;
|
||||
check_pending_block (tree target_label)
|
||||
{
|
||||
int changed = merge_type_state (target_label);
|
||||
|
||||
|
@ -129,8 +127,7 @@ subroutine_nesting (tree label)
|
|||
Return TYPE_UNKNOWN if the types cannot be merged. */
|
||||
|
||||
static tree
|
||||
merge_types (type1, type2)
|
||||
tree type1, type2;
|
||||
merge_types (tree type1, tree type2)
|
||||
{
|
||||
if (type1 == type2)
|
||||
return type1;
|
||||
|
@ -245,8 +242,7 @@ merge_types (type1, type2)
|
|||
0 if there was no change, and 1 if there was a change. */
|
||||
|
||||
int
|
||||
merge_type_state (label)
|
||||
tree label;
|
||||
merge_type_state (tree label)
|
||||
{
|
||||
int nlocals = DECL_MAX_LOCALS (current_function_decl);
|
||||
int cur_length = stack_pointer + nlocals;
|
||||
|
@ -308,8 +304,7 @@ merge_type_state (label)
|
|||
/* Handle dup-like operations. */
|
||||
|
||||
static void
|
||||
type_stack_dup (size, offset)
|
||||
int size, offset;
|
||||
type_stack_dup (int size, int offset)
|
||||
{
|
||||
tree type[4];
|
||||
int index;
|
||||
|
@ -350,9 +345,7 @@ struct pc_index
|
|||
|
||||
/* A helper that is used when sorting exception ranges. */
|
||||
static int
|
||||
start_pc_cmp (xp, yp)
|
||||
const void *xp;
|
||||
const void *yp;
|
||||
start_pc_cmp (const void *xp, const void *yp)
|
||||
{
|
||||
const struct pc_index *x = (const struct pc_index *) xp;
|
||||
const struct pc_index *y = (const struct pc_index *) yp;
|
||||
|
@ -375,8 +368,7 @@ start_pc_cmp (xp, yp)
|
|||
Return NULL on success and a freshly malloc'd error message on failure. */
|
||||
|
||||
static char *
|
||||
pop_argument_types (arg_types)
|
||||
tree arg_types;
|
||||
pop_argument_types (tree arg_types)
|
||||
{
|
||||
if (arg_types == end_params_node)
|
||||
return NULL;
|
||||
|
@ -419,10 +411,7 @@ pop_argument_types (arg_types)
|
|||
/* Verify the bytecodes of the current method.
|
||||
Return 1 on success, 0 on failure. */
|
||||
int
|
||||
verify_jvm_instructions (jcf, byte_ops, length)
|
||||
JCF* jcf;
|
||||
const unsigned char *byte_ops;
|
||||
long length;
|
||||
verify_jvm_instructions (JCF* jcf, const unsigned char *byte_ops, long length)
|
||||
{
|
||||
tree label;
|
||||
int wide = 0;
|
||||
|
|
|
@ -41,8 +41,7 @@ static xref_flag_table xref_table [] = {
|
|||
/* Decode an xref flag value. Return 0 if the flag wasn't found. */
|
||||
|
||||
int
|
||||
xref_flag_value (flag)
|
||||
const char *flag;
|
||||
xref_flag_value (const char *flag)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; xref_table [i].key; i++)
|
||||
|
@ -52,23 +51,19 @@ xref_flag_value (flag)
|
|||
}
|
||||
|
||||
void
|
||||
xref_set_data (flag, data)
|
||||
int flag;
|
||||
void *data;
|
||||
xref_set_data (int flag, void *data)
|
||||
{
|
||||
xref_table [flag-1].data = data;
|
||||
}
|
||||
|
||||
void *
|
||||
xref_get_data (flag)
|
||||
int flag;
|
||||
xref_get_data (int flag)
|
||||
{
|
||||
return xref_table [flag-1].data;
|
||||
}
|
||||
|
||||
void
|
||||
xref_set_current_fp (fp)
|
||||
FILE *fp;
|
||||
xref_set_current_fp (FILE *fp)
|
||||
{
|
||||
xref_table [flag_emit_xref-1].fp = fp;
|
||||
}
|
||||
|
@ -76,8 +71,7 @@ xref_set_current_fp (fp)
|
|||
/* Branch to the right xref "back-end". */
|
||||
|
||||
void
|
||||
expand_xref (node)
|
||||
tree node;
|
||||
expand_xref (tree node)
|
||||
{
|
||||
/* Maintain these two cached. */
|
||||
static FILE *fp = NULL;
|
||||
|
|
|
@ -222,8 +222,7 @@ static long find_zip_file_start (int fd, long offset);
|
|||
/* Function makeword() */
|
||||
/***********************/
|
||||
|
||||
static ush makeword(b)
|
||||
const uch *b;
|
||||
static ush makeword(const uch *b)
|
||||
{
|
||||
/*
|
||||
* Convert Intel style 'short' integer to non-Intel non-16-bit
|
||||
|
@ -237,8 +236,7 @@ static ush makeword(b)
|
|||
/* Function makelong() */
|
||||
/***********************/
|
||||
|
||||
static ulg makelong(sig)
|
||||
const uch *sig;
|
||||
static ulg makelong(const uch *sig)
|
||||
{
|
||||
/*
|
||||
* Convert intel style 'long' variable to non-Intel non-16-bit
|
||||
|
@ -254,9 +252,7 @@ static ulg makelong(sig)
|
|||
start of the actual data. Return -1 on error. OFFSET is the
|
||||
offset from the beginning of the zip file of the file's header. */
|
||||
static long
|
||||
find_zip_file_start (fd, offset)
|
||||
int fd;
|
||||
long offset;
|
||||
find_zip_file_start (int fd, long offset)
|
||||
{
|
||||
int filename_length, extra_field_length;
|
||||
unsigned char buffer[LREC_SIZE + 4];
|
||||
|
@ -277,8 +273,7 @@ find_zip_file_start (fd, offset)
|
|||
}
|
||||
|
||||
int
|
||||
read_zip_archive (zipf)
|
||||
register ZipFile *zipf;
|
||||
read_zip_archive (ZipFile *zipf)
|
||||
{
|
||||
int i;
|
||||
int dir_last_pad;
|
||||
|
@ -356,7 +351,7 @@ read_zip_archive (zipf)
|
|||
}
|
||||
|
||||
#ifdef TEST
|
||||
main ()
|
||||
main (void)
|
||||
{
|
||||
ZipFile zipf[1];
|
||||
ZipDirectory *zipd;
|
||||
|
|
Loading…
Reference in New Issue