diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-12 02:14:56 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-12 02:14:56 +0000 |
commit | 2883a3edf742fdc13c2730a16cc47649d6353251 (patch) | |
tree | ae14f5fe1cbe481163ab4bcb25d7f4cec4d064a8 /gcc/java/expr.c | |
parent | 5ff01bdace7c14be35f49c329cf6954f093aa7c4 (diff) | |
download | gcc-2883a3edf742fdc13c2730a16cc47649d6353251.tar.gz |
* All Files: Convert to ISO C style function definitions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61218 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r-- | gcc/java/expr.c | 284 |
1 files changed, 86 insertions, 198 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c index cd6c1b1a0a4..b36e3683041 100644 --- a/gcc/java/expr.c +++ b/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); |