Commit 31029ad7 by Kaveh R. Ghazi Committed by Kaveh Ghazi

Makefile.in (ch-version.c): Constify a char*.

	* Makefile.in (ch-version.c): Constify a char*.

	* actions.c (id_cmp, warn_unhandled, adjust_return_value,
	update_else_range_for_int_const, update_else_range_for_range,
	update_else_range_for_range_expr, update_else_range_for_type,
	compute_else_range, check_case_value,
	chill_handle_case_label_range,
	chill_handle_multi_case_label_range,
	chill_handle_multi_case_else_label, chill_handle_multi_case_label,
	chill_handle_multi_case_label_list print_missing_cases): Add
	static prototypes.
	(build_exception_variant): Cast the function argument of qsort.
	(build_rts_call, warn_unhandled, chill_convert_for_assignment,
	adjust_return_value, chill_expand_result,
	build_multi_case_selector_expression, print_missing_cases):
	Constify a char*.
	(print_missing_cases): Introduce an intermediary non-const ptr.
	Add brackets and indent.

	* ch-tree.h (maybe_building_objc_message_expr,
	maybe_objc_comptypes, comptypes_record_hook): Remove declarations.
	(push_handler, pop_handler): Add prototypes.
	(builtin_function, valid_array_index_p,
	build_chill_exception_decl, build_rts_call,
	chill_convert_for_assignment, display_int_cst,
	build_chill_addr_expr, check_have_mode, get_identifier3,
	build_chill_string, register_seize_path, get_unique_identifier,
	add_taskstuff_to_list, gnuchill_version): Constify a char*.
	(finish_chill_function): Add void prototype argument.

	* convert.c (convert_to_reference, convert_to_boolean,
	convert_to_char, base_type_size_in_bytes, remove_tree_element,
	check_ps_range, digest_powerset_tuple, digest_structure_tuple,
	digest_array_tuple, convert1): Add static prototypes.
	(base_type_size_in_bytes): Hide unused function.
	(display_int_cst, digest_array_tuple): Constify a char*.

	* decl.c (set_nesting_level, make_chill_variants, fix_identifier,
	proclaim_decl, maybe_acons, push_scope_decls, pop_scope_decls,
	build_implied_names, bind_sub_modules, layout_array_type,
	do_based_decl, handle_one_level, label_value_cmp,
	find_implied_types): Add static prototypes.
	(boolean_code_name, chill_tree_code_type, chill_tree_code_name):
	Constify a char*.
	(layout_chill_variants): Cast the function argument of qsort.
	(start_chill_function, fix_identifier, init_decl_processing):
	Constify a char*.
	(init_decl_processing): Prefer memcpy over bcopy to avoid casts.
	Use xcalloc instead of xmalloc/bzero.
	(builtin_function, build_chill_exception_decl,
	finish_outer_function): Constify a char*.

	* except.c (start_handler_array, finish_handler_array): Add static
	prototypes.

	* expr.c (chill_expand_expr, chill_expand_case_expr,
	check_arglist_length, internal_build_compound_expr,
	is_really_instance, invalid_operand, invalid_right_operand,
	build_chill_abstime, build_allocate_memory_call,
	build_allocate_global_memory_call, build_return_memory,
	build_chill_duration, build_chill_floatcall,
	build_allocate_getstack, build_chill_allocate,
	build_chill_getstack, build_chill_terminate, build_chill_inttime,
	build_chill_lower_or_upper, build_max_min,
	build_chill_pred_or_succ, expand_packed_set, fold_set_expr,
	build_compare_set_expr, scalar_to_string, build_concat_expr,
	build_compare_string_expr, compare_records, string_char_rep,
	build_boring_bitstring): Add static prototypes.
	(check_have_mode, chill_expand_expr, build_chill_floatcall,
	build_allocate_getstack, build_max_min, build_chill_function_call,
	expand_packed_set, build_compare_set_expr, build_chill_addr_expr,
	string_char_rep): Constify a char*.

	* gperf (hash, in_word_set): Add prototypes.

	* grant.c (newstring, strfree, append, prepend,
	grant_use_seizefile, decode_layout, grant_array_type,
	grant_array_type_selective, get_tag_value,
	get_tag_value_selective, print_enumeral, print_enumeral_selective,
	print_integer_type, find_enum_parent, print_integer_selective,
	print_struct, print_struct_selective, print_proc_exceptions,
	print_proc_tail, print_proc_tail_selective, find_in_decls,
	in_ridpointers, grant_seized_identifier, globalize_decl,
	grant_one_decl_selective, compare_memory_file, search_in_list,
	really_grant_this): Add static prototypes.
	(newstring, append, prepend, grant_use_seizefile,
	print_integer_type, decode_constant, grant_one_decl_selective,
	header_template): Constify a char *.

	* inout.c (add_enum_to_list, build_chill_io_list_type,
	build_io_types, declare_predefined_file, build_access_part,
	textlocation_mode, check_assoc, assoc_call, check_transfer,
	connect_process_optionals, connect_text, connect_access,
	check_access, check_text, get_final_type_and_range,
	process_io_list, check_format_string, get_max_size,
	check_exprlist): Add static prototypes.
	(declare_predefined_file, check_assoc, assoc_call, check_transfer,
	check_access, check_text, process_io_list): Constify a char*.

	* lang.c (deep_const_expr, chill_print_error_function): Add static
	prototypes.

	* lex.c (close_input_file, maybe_number, string_or_char): Constify
	a char*.
	(ch_lex_init, skip_directive, same_file, getlc, yywrap,
	yy_refill): Add static prototypes.
	(build_chill_string, same_file, register_seize_path): Constify a
	char*.

	* lex.h (finish_chill_seizes): Remove unused prototypes.

	* loop.c (build_temporary_variable, maybe_make_for_temp,
	get_unique_identifier): Constify a char*.

	* parse.c (ch_parse_init, check_end_label, end_function,
	build_prefix_clause, PEEK_TOKEN, peek_token_, pushback_token,
	forward_token_, require, check_token, expect, define__PROCNAME__):
	Add static prototypes.
	(build_prefix_clause, expect): Constify a char*.
	(parse_expression, parse_primval, parse_untyped_expr,
	parse_opt_untyped_expr, parse_opt_actions): Add void prototype
	argument.
	(parse_opt_name_string, parse_simple_name_string,
	parse_name_string, parse_defining_occurrence, parse_name,
	parse_optlabel, parse_opt_end_label_semi_colon, parse_modulion,
	parse_spec_module, parse_semi_colon,
	parse_defining_occurrence_list, parse_mode_definition,
	parse_mode_definition_statement, parse_synonym_definition,
	parse_synonym_definition_statement, parse_on_exception_list,
	parse_on_alternatives, parse_loc_declaration,
	parse_declaration_statement, parse_optforbid, parse_postfix,
	parse_postfix_list, parse_rename_clauses, parse_opt_prefix_clause,
	parse_grant_statement, parse_seize_statement,
	parse_param_name_list, parse_param_attr, parse_formpar,
	parse_formparlist, parse_opt_result_spec, parse_opt_except,
	parse_opt_recursive, parse_procedureattr, parse_proc_body,
	parse_procedure_definition, parse_processpar,
	parse_processparlist, parse_process_definition,
	parse_signal_definition, parse_signal_definition_statement,
	parse_then_clause, parse_opt_else_clause, parse_expr_list,
	parse_range_list_clause, pushback_paren_expr, parse_case_label,
	parse_case_label_list, parse_case_label_specification,
	parse_single_dimension_case_action,
	parse_multi_dimension_case_action, parse_case_action,
	parse_asm_operands, parse_asm_clobbers, ch_expand_asm_operands,
	parse_asm_action, parse_begin_end_block, parse_if_action,
	parse_iteration, parse_delay_case_event_list,
	parse_delay_case_action, parse_do_action, parse_receive_spec,
	parse_receive_case_action, parse_send_action, parse_start_action,
	parse_call, parse_tuple_fieldname_list, parse_tuple_element,
	parse_opt_element_list, parse_tuple, parse_operand6,
	parse_operand5, parse_operand4, parse_operand3, parse_operand2,
	parse_operand1, parse_operand0, parse_case_expression,
	parse_then_alternative, parse_else_alternative,
	parse_if_expression, parse_index_mode, parse_set_mode, parse_pos,
	parse_step, parse_opt_layout, parse_field_name_list,
	parse_fixed_field, parse_variant_field_list,
	parse_variant_alternative, parse_field, parse_structure_mode,
	parse_opt_queue_size, parse_procedure_mode, parse_program,
	parse_pass_1_2): Add static prototypes.
	(parse_process_definition): Remove extra argument in function call.
	(parse_range_list_clause): Likewise.

	* satisfy.c (satisfy, cycle_error_print, safe_satisfy_decl,
	satisfy_list, satisfy_list_values): Add static prototype.
	(safe_satisfy_decl): Cast DECL_TASKING_CODE_DECL() to (tree).

	* tasking.c (make_process_struct): Remove unused prototype.
	(validate_process_parameters, get_struct_variable_name,
	decl_tasking_code_variable, get_struct_debug_type_name,
	get_process_wrapper_name, build_tasking_enum,
	build_tasking_message_type, build_receive_signal_case_label,
	build_receive_buffer_case_label, build_receive_buffer_case_end,
	build_receive_signal_case_end): Add static prototypes.
	(struct_name, struct_debug_name, data_name, wrapper_name,
	get_struct_type_name, get_struct_debug_type_name,
	get_tasking_code_name, get_struct_variable_name,
	get_process_wrapper_name): Constify a char*.
	(validate_process_parameters, get_struct_variable_name,
	decl_tasking_code_variable): Hide unused functions.
	(build_start_process, add_taskstuff_to_list, build_queue_length):
	Constify a char*.

	* tree.c (make_powerset_type): Add static prototype.
	(get_identifier3, build_alias_decl, decl_check_rename): Constify a
	char*.

	* typeck.c (extract_constant_from_buffer,
	expand_constant_to_buffer, build_empty_string,
	make_chill_pointer_type, make_chill_range_type,
	apply_chill_array_layout, field_decl_cmp, make_chill_struct_type,
	apply_chill_field_layout): Add static prototype.
	(valid_array_index_p, extract_constant_from_buffer,
	chill_expand_tuple): Constify a char*.
	(layout_chill_struct_type): Cast the function argument of qsort.

From-SVN: r28965
parent cd0e1e48
1999-08-29 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (ch-version.c): Constify a char*.
* actions.c (id_cmp, warn_unhandled, adjust_return_value,
update_else_range_for_int_const, update_else_range_for_range,
update_else_range_for_range_expr, update_else_range_for_type,
compute_else_range, check_case_value,
chill_handle_case_label_range,
chill_handle_multi_case_label_range,
chill_handle_multi_case_else_label, chill_handle_multi_case_label,
chill_handle_multi_case_label_list print_missing_cases): Add
static prototypes.
(build_exception_variant): Cast the function argument of qsort.
(build_rts_call, warn_unhandled, chill_convert_for_assignment,
adjust_return_value, chill_expand_result,
build_multi_case_selector_expression, print_missing_cases):
Constify a char*.
(print_missing_cases): Introduce an intermediary non-const ptr.
Add brackets and indent.
* ch-tree.h (maybe_building_objc_message_expr,
maybe_objc_comptypes, comptypes_record_hook): Remove declarations.
(push_handler, pop_handler): Add prototypes.
(builtin_function, valid_array_index_p,
build_chill_exception_decl, build_rts_call,
chill_convert_for_assignment, display_int_cst,
build_chill_addr_expr, check_have_mode, get_identifier3,
build_chill_string, register_seize_path, get_unique_identifier,
add_taskstuff_to_list, gnuchill_version): Constify a char*.
(finish_chill_function): Add void prototype argument.
* convert.c (convert_to_reference, convert_to_boolean,
convert_to_char, base_type_size_in_bytes, remove_tree_element,
check_ps_range, digest_powerset_tuple, digest_structure_tuple,
digest_array_tuple, convert1): Add static prototypes.
(base_type_size_in_bytes): Hide unused function.
(display_int_cst, digest_array_tuple): Constify a char*.
* decl.c (set_nesting_level, make_chill_variants, fix_identifier,
proclaim_decl, maybe_acons, push_scope_decls, pop_scope_decls,
build_implied_names, bind_sub_modules, layout_array_type,
do_based_decl, handle_one_level, label_value_cmp,
find_implied_types): Add static prototypes.
(boolean_code_name, chill_tree_code_type, chill_tree_code_name):
Constify a char*.
(layout_chill_variants): Cast the function argument of qsort.
(start_chill_function, fix_identifier, init_decl_processing):
Constify a char*.
(init_decl_processing): Prefer memcpy over bcopy to avoid casts.
Use xcalloc instead of xmalloc/bzero.
(builtin_function, build_chill_exception_decl,
finish_outer_function): Constify a char*.
* except.c (start_handler_array, finish_handler_array): Add static
prototypes.
* expr.c (chill_expand_expr, chill_expand_case_expr,
check_arglist_length, internal_build_compound_expr,
is_really_instance, invalid_operand, invalid_right_operand,
build_chill_abstime, build_allocate_memory_call,
build_allocate_global_memory_call, build_return_memory,
build_chill_duration, build_chill_floatcall,
build_allocate_getstack, build_chill_allocate,
build_chill_getstack, build_chill_terminate, build_chill_inttime,
build_chill_lower_or_upper, build_max_min,
build_chill_pred_or_succ, expand_packed_set, fold_set_expr,
build_compare_set_expr, scalar_to_string, build_concat_expr,
build_compare_string_expr, compare_records, string_char_rep,
build_boring_bitstring): Add static prototypes.
(check_have_mode, chill_expand_expr, build_chill_floatcall,
build_allocate_getstack, build_max_min, build_chill_function_call,
expand_packed_set, build_compare_set_expr, build_chill_addr_expr,
string_char_rep): Constify a char*.
* gperf (hash, in_word_set): Add prototypes.
* grant.c (newstring, strfree, append, prepend,
grant_use_seizefile, decode_layout, grant_array_type,
grant_array_type_selective, get_tag_value,
get_tag_value_selective, print_enumeral, print_enumeral_selective,
print_integer_type, find_enum_parent, print_integer_selective,
print_struct, print_struct_selective, print_proc_exceptions,
print_proc_tail, print_proc_tail_selective, find_in_decls,
in_ridpointers, grant_seized_identifier, globalize_decl,
grant_one_decl_selective, compare_memory_file, search_in_list,
really_grant_this): Add static prototypes.
(newstring, append, prepend, grant_use_seizefile,
print_integer_type, decode_constant, grant_one_decl_selective,
header_template): Constify a char *.
* inout.c (add_enum_to_list, build_chill_io_list_type,
build_io_types, declare_predefined_file, build_access_part,
textlocation_mode, check_assoc, assoc_call, check_transfer,
connect_process_optionals, connect_text, connect_access,
check_access, check_text, get_final_type_and_range,
process_io_list, check_format_string, get_max_size,
check_exprlist): Add static prototypes.
(declare_predefined_file, check_assoc, assoc_call, check_transfer,
check_access, check_text, process_io_list): Constify a char*.
* lang.c (deep_const_expr, chill_print_error_function): Add static
prototypes.
* lex.c (close_input_file, maybe_number, string_or_char): Constify
a char*.
(ch_lex_init, skip_directive, same_file, getlc, yywrap,
yy_refill): Add static prototypes.
(build_chill_string, same_file, register_seize_path): Constify a
char*.
* lex.h (finish_chill_seizes): Remove unused prototypes.
* loop.c (build_temporary_variable, maybe_make_for_temp,
get_unique_identifier): Constify a char*.
* parse.c (ch_parse_init, check_end_label, end_function,
build_prefix_clause, PEEK_TOKEN, peek_token_, pushback_token,
forward_token_, require, check_token, expect, define__PROCNAME__):
Add static prototypes.
(build_prefix_clause, expect): Constify a char*.
(parse_expression, parse_primval, parse_untyped_expr,
parse_opt_untyped_expr, parse_opt_actions): Add void prototype
argument.
(parse_opt_name_string, parse_simple_name_string,
parse_name_string, parse_defining_occurrence, parse_name,
parse_optlabel, parse_opt_end_label_semi_colon, parse_modulion,
parse_spec_module, parse_semi_colon,
parse_defining_occurrence_list, parse_mode_definition,
parse_mode_definition_statement, parse_synonym_definition,
parse_synonym_definition_statement, parse_on_exception_list,
parse_on_alternatives, parse_loc_declaration,
parse_declaration_statement, parse_optforbid, parse_postfix,
parse_postfix_list, parse_rename_clauses, parse_opt_prefix_clause,
parse_grant_statement, parse_seize_statement,
parse_param_name_list, parse_param_attr, parse_formpar,
parse_formparlist, parse_opt_result_spec, parse_opt_except,
parse_opt_recursive, parse_procedureattr, parse_proc_body,
parse_procedure_definition, parse_processpar,
parse_processparlist, parse_process_definition,
parse_signal_definition, parse_signal_definition_statement,
parse_then_clause, parse_opt_else_clause, parse_expr_list,
parse_range_list_clause, pushback_paren_expr, parse_case_label,
parse_case_label_list, parse_case_label_specification,
parse_single_dimension_case_action,
parse_multi_dimension_case_action, parse_case_action,
parse_asm_operands, parse_asm_clobbers, ch_expand_asm_operands,
parse_asm_action, parse_begin_end_block, parse_if_action,
parse_iteration, parse_delay_case_event_list,
parse_delay_case_action, parse_do_action, parse_receive_spec,
parse_receive_case_action, parse_send_action, parse_start_action,
parse_call, parse_tuple_fieldname_list, parse_tuple_element,
parse_opt_element_list, parse_tuple, parse_operand6,
parse_operand5, parse_operand4, parse_operand3, parse_operand2,
parse_operand1, parse_operand0, parse_case_expression,
parse_then_alternative, parse_else_alternative,
parse_if_expression, parse_index_mode, parse_set_mode, parse_pos,
parse_step, parse_opt_layout, parse_field_name_list,
parse_fixed_field, parse_variant_field_list,
parse_variant_alternative, parse_field, parse_structure_mode,
parse_opt_queue_size, parse_procedure_mode, parse_program,
parse_pass_1_2): Add static prototypes.
(parse_process_definition): Remove extra argument in function call.
(parse_range_list_clause): Likewise.
* satisfy.c (satisfy, cycle_error_print, safe_satisfy_decl,
satisfy_list, satisfy_list_values): Add static prototype.
(safe_satisfy_decl): Cast DECL_TASKING_CODE_DECL() to (tree).
* tasking.c (make_process_struct): Remove unused prototype.
(validate_process_parameters, get_struct_variable_name,
decl_tasking_code_variable, get_struct_debug_type_name,
get_process_wrapper_name, build_tasking_enum,
build_tasking_message_type, build_receive_signal_case_label,
build_receive_buffer_case_label, build_receive_buffer_case_end,
build_receive_signal_case_end): Add static prototypes.
(struct_name, struct_debug_name, data_name, wrapper_name,
get_struct_type_name, get_struct_debug_type_name,
get_tasking_code_name, get_struct_variable_name,
get_process_wrapper_name): Constify a char*.
(validate_process_parameters, get_struct_variable_name,
decl_tasking_code_variable): Hide unused functions.
(build_start_process, add_taskstuff_to_list, build_queue_length):
Constify a char*.
* tree.c (make_powerset_type): Add static prototype.
(get_identifier3, build_alias_decl, decl_check_rename): Constify a
char*.
* typeck.c (extract_constant_from_buffer,
expand_constant_to_buffer, build_empty_string,
make_chill_pointer_type, make_chill_range_type,
apply_chill_array_layout, field_decl_cmp, make_chill_struct_type,
apply_chill_field_layout): Add static prototype.
(valid_array_index_p, extract_constant_from_buffer,
chill_expand_tuple): Constify a char*.
(layout_chill_struct_type): Cast the function argument of qsort.
1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 1999-08-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* actions.c (lang_identify): Constify a char*. * actions.c (lang_identify): Constify a char*.
......
...@@ -316,7 +316,7 @@ typeck.o : typeck.c $(CONFIG_H) $(CHILL_TREE_H) ../insn-codes.h \ ...@@ -316,7 +316,7 @@ typeck.o : typeck.c $(CONFIG_H) $(CHILL_TREE_H) ../insn-codes.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h $(srcdir)/../system.h $(srcdir)/../toplev.h
ch-version.o : ch-version.c ch-version.o : ch-version.c
ch-version.c : Makefile ch-version.c : Makefile
echo 'char *gnuchill_version = "$(GNUCHILL_VERSION)";' > $@ echo 'const char * const gnuchill_version = "$(GNUCHILL_VERSION)";' > $@
## This is ugly, but I don't want GNU make to put these variables in ## This is ugly, but I don't want GNU make to put these variables in
## the environment. Older makes will see this as a set of targets ## the environment. Older makes will see this as a set of targets
......
...@@ -32,6 +32,22 @@ Boston, MA 02111-1307, USA. */ ...@@ -32,6 +32,22 @@ Boston, MA 02111-1307, USA. */
#include "assert.h" #include "assert.h"
#include "toplev.h" #include "toplev.h"
static int id_cmp PROTO ((tree *, tree *));
static void warn_unhandled PROTO ((const char *));
static tree adjust_return_value PROTO ((tree, const char *));
static tree update_else_range_for_int_const PROTO ((tree, tree));
static tree update_else_range_for_range PROTO ((tree, tree, tree));
static tree update_else_range_for_range_expr PROTO ((tree, tree));
static tree update_else_range_for_type PROTO ((tree, tree));
static tree compute_else_range PROTO ((tree, tree, int));
static tree check_case_value PROTO ((tree, tree));
static void chill_handle_case_label_range PROTO ((tree, tree, tree));
static tree chill_handle_multi_case_label_range PROTO ((tree, tree, tree));
static tree chill_handle_multi_case_else_label PROTO ((tree));
static tree chill_handle_multi_case_label PROTO ((tree, tree));
static tree chill_handle_multi_case_label_list PROTO ((tree, tree));
static void print_missing_cases PROTO ((tree, const unsigned char *, long));
#define obstack_chunk_alloc xmalloc #define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free #define obstack_chunk_free free
...@@ -155,7 +171,8 @@ build_exception_variant (type, raises) ...@@ -155,7 +171,8 @@ build_exception_variant (type, raises)
a[i] = t; a[i] = t;
/* NULL terminator for list. */ /* NULL terminator for list. */
a[i] = NULL_TREE; a[i] = NULL_TREE;
qsort (a, i, sizeof (tree), id_cmp); qsort (a, i, sizeof (tree),
(int (*) PROTO((const void*, const void*))) id_cmp);
while (i--) while (i--)
TREE_CHAIN (a[i]) = a[i+1]; TREE_CHAIN (a[i]) = a[i+1];
raises = a[0]; raises = a[0];
...@@ -214,7 +231,7 @@ build_exception_variant (type, raises) ...@@ -214,7 +231,7 @@ build_exception_variant (type, raises)
tree tree
build_rts_call (name, type, args) build_rts_call (name, type, args)
char *name; const char *name;
tree type, args; tree type, args;
{ {
tree decl = lookup_name (get_identifier (name)); tree decl = lookup_name (get_identifier (name));
...@@ -262,7 +279,7 @@ static struct already_type *already_warned = 0; ...@@ -262,7 +279,7 @@ static struct already_type *already_warned = 0;
static void static void
warn_unhandled (ex) warn_unhandled (ex)
char *ex; const char *ex;
{ {
struct already_type *p = already_warned; struct already_type *p = already_warned;
...@@ -460,7 +477,7 @@ check_non_null (expr) ...@@ -460,7 +477,7 @@ check_non_null (expr)
tree tree
chill_convert_for_assignment (type, expr, place) chill_convert_for_assignment (type, expr, place)
tree type, expr; tree type, expr;
char *place; /* location description for error messages */ const char *place; /* location description for error messages */
{ {
tree ttype = type; tree ttype = type;
tree etype = TREE_TYPE (expr); tree etype = TREE_TYPE (expr);
...@@ -596,7 +613,7 @@ chill_convert_for_assignment (type, expr, place) ...@@ -596,7 +613,7 @@ chill_convert_for_assignment (type, expr, place)
static tree static tree
adjust_return_value (expr, action) adjust_return_value (expr, action)
tree expr; tree expr;
char *action; const char *action;
{ {
tree type = TREE_TYPE (TREE_TYPE (current_function_decl)); tree type = TREE_TYPE (TREE_TYPE (current_function_decl));
...@@ -632,7 +649,7 @@ chill_expand_result (expr, result_or_return) ...@@ -632,7 +649,7 @@ chill_expand_result (expr, result_or_return)
int result_or_return; int result_or_return;
{ {
tree type; tree type;
char *action_name = result_or_return ? "RESULT" : "RETURN"; const char *action_name = result_or_return ? "RESULT" : "RETURN";
if (pass == 1) if (pass == 1)
return; return;
...@@ -1352,7 +1369,7 @@ build_multi_case_selector_expression (selector_list, label_spec) ...@@ -1352,7 +1369,7 @@ build_multi_case_selector_expression (selector_list, label_spec)
static void static void
print_missing_cases (type, cases_seen, count) print_missing_cases (type, cases_seen, count)
tree type; tree type;
unsigned char *cases_seen; const unsigned char *cases_seen;
long count; long count;
{ {
long i; long i;
...@@ -1364,7 +1381,7 @@ print_missing_cases (type, cases_seen, count) ...@@ -1364,7 +1381,7 @@ print_missing_cases (type, cases_seen, count)
long x = i; long x = i;
long j; long j;
tree t = type; tree t = type;
char *err_val_name = "???"; const char *err_val_name = "???";
if (TYPE_MIN_VALUE (t) if (TYPE_MIN_VALUE (t)
&& TREE_CODE (TYPE_MIN_VALUE (t)) == INTEGER_CST) && TREE_CODE (TYPE_MIN_VALUE (t)) == INTEGER_CST)
x += TREE_INT_CST_LOW (TYPE_MIN_VALUE (t)); x += TREE_INT_CST_LOW (TYPE_MIN_VALUE (t));
...@@ -1377,24 +1394,28 @@ print_missing_cases (type, cases_seen, count) ...@@ -1377,24 +1394,28 @@ print_missing_cases (type, cases_seen, count)
err_val_name = x ? "TRUE" : "FALSE"; err_val_name = x ? "TRUE" : "FALSE";
break; break;
case CHAR_TYPE: case CHAR_TYPE:
{
char *bufptr;
if ((x >= ' ' && x < 127) && x != '\'' && x != '^') if ((x >= ' ' && x < 127) && x != '\'' && x != '^')
sprintf (buf, "'%c'", (char)x); sprintf (buf, "'%c'", (char)x);
else else
sprintf (buf, "'^(%ld)'", x); sprintf (buf, "'^(%ld)'", x);
err_val_name = buf; bufptr = buf;
j = i; j = i;
while (j < count && !BITARRAY_TEST(cases_seen, j)) while (j < count && !BITARRAY_TEST(cases_seen, j))
j++; j++;
if (j > i + 1) if (j > i + 1)
{ {
long y = x+j-i-1; long y = x+j-i-1;
err_val_name += strlen (err_val_name); bufptr += strlen (bufptr);
if ((y >= ' ' && y < 127) && y != '\'' && y != '^') if ((y >= ' ' && y < 127) && y != '\'' && y != '^')
sprintf (err_val_name, "%s:'%c'", buf, (char)y); sprintf (bufptr, "%s:'%c'", buf, (char)y);
else else
sprintf (err_val_name, "%s:'^(%ld)'", buf, y); sprintf (bufptr, "%s:'^(%ld)'", buf, y);
i = j - 1; i = j - 1;
} }
err_val_name = bufptr;
}
break; break;
case ENUMERAL_TYPE: case ENUMERAL_TYPE:
for (v = TYPE_VALUES (t); v && x; v = TREE_CHAIN (v)) for (v = TYPE_VALUES (t); v && x; v = TREE_CHAIN (v))
......
...@@ -374,9 +374,6 @@ struct mode_chain; /* Forward reference */ ...@@ -374,9 +374,6 @@ struct mode_chain; /* Forward reference */
#define CH_REFERABLE(EXPR) chill_referable(EXPR) #define CH_REFERABLE(EXPR) chill_referable(EXPR)
#define CH_LOCATION_P(EXPR) chill_location (EXPR) #define CH_LOCATION_P(EXPR) chill_location (EXPR)
extern int maybe_objc_comptypes ();
extern tree maybe_building_objc_message_expr ();
/* Standard named or nameless data types of the C compiler. */ /* Standard named or nameless data types of the C compiler. */
/* Nonzero means `$' can be in an identifier. */ /* Nonzero means `$' can be in an identifier. */
...@@ -457,11 +454,6 @@ extern int flag_traditional; ...@@ -457,11 +454,6 @@ extern int flag_traditional;
extern int warn_parentheses; extern int warn_parentheses;
/* Nonzero means this is a function to call to perform comptypes
on two record types. */
extern int (*comptypes_record_hook) ();
/* Nonzero means we are reading code that came from a system header file. */ /* Nonzero means we are reading code that came from a system header file. */
extern int system_header_p; extern int system_header_p;
...@@ -666,6 +658,8 @@ extern tree global_function_decl; ...@@ -666,6 +658,8 @@ extern tree global_function_decl;
/* in except.c */ /* in except.c */
extern void except_init_pass_2 PROTO((void)); extern void except_init_pass_2 PROTO((void));
extern void push_handler PROTO((void));
extern void pop_handler PROTO((int));
/* in ch-loop.c */ /* in ch-loop.c */
extern int flag_local_loop_counter; extern int flag_local_loop_counter;
...@@ -681,7 +675,7 @@ extern void nonvalue_begin_loop_scope PROTO((void)); ...@@ -681,7 +675,7 @@ extern void nonvalue_begin_loop_scope PROTO((void));
extern void nonvalue_end_loop_scope PROTO((void)); extern void nonvalue_end_loop_scope PROTO((void));
extern tree build_enumerator PROTO((tree, tree)); extern tree build_enumerator PROTO((tree, tree));
extern tree builtin_function PROTO((char *, tree, enum built_in_function function_, char *)); extern tree builtin_function PROTO((const char *, tree, enum built_in_function function_, const char *));
extern tree c_build_type_variant PROTO((tree, int, int)); extern tree c_build_type_variant PROTO((tree, int, int));
extern int c_decode_option PROTO((int, char **)); extern int c_decode_option PROTO((int, char **));
extern void c_mark_varargs PROTO((void)); extern void c_mark_varargs PROTO((void));
...@@ -769,7 +763,7 @@ extern void set_init_index PROTO((tree, tree)); ...@@ -769,7 +763,7 @@ extern void set_init_index PROTO((tree, tree));
extern void set_init_label PROTO((tree)); extern void set_init_label PROTO((tree));
extern void start_init PROTO((tree, tree, int)); extern void start_init PROTO((tree, tree, int));
extern void store_init_value PROTO((tree, tree)); extern void store_init_value PROTO((tree, tree));
extern tree valid_array_index_p PROTO((tree, tree, char *, int)); extern tree valid_array_index_p PROTO((tree, tree, const char *, int));
/* in ch/actions.c */ /* in ch/actions.c */
extern int grant_only_flag; extern int grant_only_flag;
...@@ -782,7 +776,7 @@ extern tree build_chill_binary_op PROTO((enum chill_tree_code, tre ...@@ -782,7 +776,7 @@ extern tree build_chill_binary_op PROTO((enum chill_tree_code, tre
extern tree build_chill_card PROTO((tree)); extern tree build_chill_card PROTO((tree));
extern tree build_chill_case_expr PROTO((tree, tree, tree)); extern tree build_chill_case_expr PROTO((tree, tree, tree));
extern tree build_cause_exception PROTO((tree, int)); extern tree build_cause_exception PROTO((tree, int));
extern tree build_chill_exception_decl PROTO((char *)); extern tree build_chill_exception_decl PROTO((const char *));
extern tree build_chill_function_call PROTO((tree, tree)); extern tree build_chill_function_call PROTO((tree, tree));
extern tree build_chill_length PROTO((tree)); extern tree build_chill_length PROTO((tree));
extern tree build_chill_indirect_ref PROTO((tree, tree, int)); extern tree build_chill_indirect_ref PROTO((tree, tree, int));
...@@ -801,10 +795,10 @@ extern tree build_chill_upper PROTO((tree)); ...@@ -801,10 +795,10 @@ extern tree build_chill_upper PROTO((tree));
extern tree build_exception_variant PROTO((tree, tree)); extern tree build_exception_variant PROTO((tree, tree));
extern tree build_generalized_call PROTO((tree, tree)); extern tree build_generalized_call PROTO((tree, tree));
extern tree build_lang_decl PROTO((enum chill_tree_code, tree, tree)); extern tree build_lang_decl PROTO((enum chill_tree_code, tree, tree));
extern tree build_rts_call PROTO((char *, tree, tree)); extern tree build_rts_call PROTO((const char *, tree, tree));
extern tree build_varying_struct PROTO((tree)); extern tree build_varying_struct PROTO((tree));
extern void chill_check_decl PROTO((tree)); extern void chill_check_decl PROTO((tree));
extern tree chill_convert_for_assignment PROTO((tree, tree, char*)); extern tree chill_convert_for_assignment PROTO((tree, tree, const char *));
extern void chill_expand_return PROTO((tree, int)); extern void chill_expand_return PROTO((tree, int));
extern void chill_expand_result PROTO((tree, int)); extern void chill_expand_result PROTO((tree, int));
extern void chill_handle_case_default PROTO((void)); extern void chill_handle_case_default PROTO((void));
...@@ -831,7 +825,7 @@ extern tree build_array_type_for_scalar PROTO((tree)); ...@@ -831,7 +825,7 @@ extern tree build_array_type_for_scalar PROTO((tree));
extern tree convert PROTO((tree, tree)); extern tree convert PROTO((tree, tree));
extern tree convert_from_reference PROTO((tree)); extern tree convert_from_reference PROTO((tree));
extern tree convert_to_class PROTO((ch_class, tree)); extern tree convert_to_class PROTO((ch_class, tree));
extern char* display_int_cst PROTO((tree)); extern const char *display_int_cst PROTO((tree));
/* in ch/decl.c */ /* in ch/decl.c */
extern tree build_enumerator PROTO((tree, tree)); extern tree build_enumerator PROTO((tree, tree));
...@@ -844,7 +838,7 @@ extern tree do_decl PROTO((tree, tree, int, int, tre ...@@ -844,7 +838,7 @@ extern tree do_decl PROTO((tree, tree, int, int, tre
extern void do_decls PROTO((tree, tree, int, int, tree, int)); extern void do_decls PROTO((tree, tree, int, int, tree, int));
extern void expand_chill_outparms PROTO((void)); extern void expand_chill_outparms PROTO((void));
extern void find_granted_decls PROTO((void)); extern void find_granted_decls PROTO((void));
extern void finish_chill_function PROTO(()); extern void finish_chill_function PROTO((void));
extern tree finish_enum PROTO((tree, tree)); extern tree finish_enum PROTO((tree, tree));
extern void fixup_chill_parms PROTO((tree)); extern void fixup_chill_parms PROTO((tree));
extern void finish_outer_function PROTO((void)); extern void finish_outer_function PROTO((void));
...@@ -885,7 +879,7 @@ extern void expand_goto_except_cleanup PROTO((int)); ...@@ -885,7 +879,7 @@ extern void expand_goto_except_cleanup PROTO((int));
extern int is_handled PROTO((tree)); extern int is_handled PROTO((tree));
/* in ch/expr.c */ /* in ch/expr.c */
extern tree build_chill_addr_expr PROTO((tree, char *)); extern tree build_chill_addr_expr PROTO((tree, const char *));
extern tree build_chill_arrow_expr PROTO((tree, int)); extern tree build_chill_arrow_expr PROTO((tree, int));
extern tree build_component_ref PROTO((tree, tree)); extern tree build_component_ref PROTO((tree, tree));
extern tree build_chill_compound_expr PROTO((tree)); extern tree build_chill_compound_expr PROTO((tree));
...@@ -898,7 +892,7 @@ extern tree build_compare_discrete_expr PROTO((enum tree_code, ...@@ -898,7 +892,7 @@ extern tree build_compare_discrete_expr PROTO((enum tree_code,
tree, tree)); tree, tree));
extern tree check_case_selector PROTO((tree)); extern tree check_case_selector PROTO((tree));
extern tree check_case_selector_list PROTO((tree)); extern tree check_case_selector_list PROTO((tree));
extern tree check_have_mode PROTO((tree, char*)); extern tree check_have_mode PROTO((tree, const char *));
extern void init_chill_expand PROTO((void)); extern void init_chill_expand PROTO((void));
extern void chill_expand_assignment PROTO((tree, enum chill_tree_code, tree)); extern void chill_expand_assignment PROTO((tree, enum chill_tree_code, tree));
extern void expand_assignment_action PROTO((tree, enum chill_tree_code, tree)); extern void expand_assignment_action PROTO((tree, enum chill_tree_code, tree));
...@@ -934,7 +928,7 @@ extern tree build_chill_range_type PROTO((tree, tree, tree)); ...@@ -934,7 +928,7 @@ extern tree build_chill_range_type PROTO((tree, tree, tree));
extern tree build_chill_reference_type PROTO((tree)); extern tree build_chill_reference_type PROTO((tree));
extern tree build_simple_array_type PROTO((tree, tree, tree)); extern tree build_simple_array_type PROTO((tree, tree, tree));
extern tree const_expr PROTO((tree)); extern tree const_expr PROTO((tree));
extern tree get_identifier3 PROTO((char*, char*, char*)); extern tree get_identifier3 PROTO((const char *, const char *, const char *));
extern tree layout_chill_array_type PROTO((tree)); extern tree layout_chill_array_type PROTO((tree));
extern tree layout_chill_range_type PROTO((tree, int)); extern tree layout_chill_range_type PROTO((tree, int));
extern tree layout_chill_pointer_type PROTO((tree)); extern tree layout_chill_pointer_type PROTO((tree));
...@@ -950,11 +944,11 @@ extern int recognize_objc_keyword PROTO((void)); ...@@ -950,11 +944,11 @@ extern int recognize_objc_keyword PROTO((void));
/* in ch/lex.l */ /* in ch/lex.l */
extern tree use_seizefile_name; extern tree use_seizefile_name;
extern tree current_seizefile_name; extern tree current_seizefile_name;
extern tree build_chill_string PROTO((int, char *)); extern tree build_chill_string PROTO((int, const char *));
extern int check_newline PROTO((void)); extern int check_newline PROTO((void));
extern tree get_chill_filename PROTO((void)); extern tree get_chill_filename PROTO((void));
extern tree get_chill_linenumber PROTO((void)); extern tree get_chill_linenumber PROTO((void));
extern void register_seize_path PROTO((char *)); extern void register_seize_path PROTO((const char *));
extern void reinit_parse_for_function PROTO((void)); extern void reinit_parse_for_function PROTO((void));
extern void mark_use_seizefile_written PROTO((tree)); extern void mark_use_seizefile_written PROTO((tree));
...@@ -962,7 +956,7 @@ extern void mark_use_seizefile_written PROTO((tree)); ...@@ -962,7 +956,7 @@ extern void mark_use_seizefile_written PROTO((tree));
extern void begin_chill_loop PROTO((tree, tree)); extern void begin_chill_loop PROTO((tree, tree));
extern tree build_chill_iterator PROTO((tree, tree, tree, int, int, int)); extern tree build_chill_iterator PROTO((tree, tree, tree, int, int, int));
extern void end_chill_loop PROTO((void)); extern void end_chill_loop PROTO((void));
extern tree get_unique_identifier PROTO((char *)); extern tree get_unique_identifier PROTO((const char *));
/* in ch/inout.c */ /* in ch/inout.c */
extern tree access_recordmode PROTO((tree)); extern tree access_recordmode PROTO((tree));
...@@ -1027,7 +1021,7 @@ extern void to_global_binding_level PROTO((void)); ...@@ -1027,7 +1021,7 @@ extern void to_global_binding_level PROTO((void));
extern tree satisfy_decl PROTO((tree, int)); extern tree satisfy_decl PROTO((tree, int));
/* in ch/tasking.c */ /* in ch/tasking.c */
extern void add_taskstuff_to_list PROTO((tree, char *, tree, tree, tree)); extern void add_taskstuff_to_list PROTO((tree, const char *, tree, tree, tree));
extern void process_buffer_decls PROTO((tree, tree, int)); extern void process_buffer_decls PROTO((tree, tree, int));
extern tree buffer_element_mode PROTO((tree)); extern tree buffer_element_mode PROTO((tree));
extern void invalidate_buffer_element_mode PROTO((tree)); extern void invalidate_buffer_element_mode PROTO((tree));
...@@ -1187,4 +1181,7 @@ extern struct module *current_module; ...@@ -1187,4 +1181,7 @@ extern struct module *current_module;
/* fold a tree to constant as much as possible */ /* fold a tree to constant as much as possible */
extern tree deep_fold PROTO((tree)); extern tree deep_fold PROTO((tree));
extern const char * const gnuchill_version;
#endif #endif
...@@ -37,6 +37,19 @@ extern tree bit_one_node, bit_zero_node; ...@@ -37,6 +37,19 @@ extern tree bit_one_node, bit_zero_node;
extern tree string_one_type_node; extern tree string_one_type_node;
extern tree bitstring_one_type_node; extern tree bitstring_one_type_node;
static tree convert_to_reference PROTO ((tree, tree));
static tree convert_to_boolean PROTO ((tree, tree));
static tree convert_to_char PROTO ((tree, tree));
#if 0
static tree base_type_size_in_bytes PROTO ((tree));
#endif
static tree remove_tree_element PROTO ((tree, tree *));
static tree check_ps_range PROTO ((tree, tree, tree));
static tree digest_powerset_tuple PROTO ((tree, tree));
static tree digest_structure_tuple PROTO ((tree, tree));
static tree digest_array_tuple PROTO ((tree, tree, int));
static tree convert1 PROTO ((tree, tree));
static tree static tree
convert_to_reference (reftype, expr) convert_to_reference (reftype, expr)
tree reftype, expr; tree reftype, expr;
...@@ -143,7 +156,8 @@ convert_to_char (type, expr) ...@@ -143,7 +156,8 @@ convert_to_char (type, expr)
} }
} }
tree #if 0
static tree
base_type_size_in_bytes (type) base_type_size_in_bytes (type)
tree type; tree type;
{ {
...@@ -153,6 +167,7 @@ base_type_size_in_bytes (type) ...@@ -153,6 +167,7 @@ base_type_size_in_bytes (type)
return error_mark_node; return error_mark_node;
return size_in_bytes (TREE_TYPE (type)); return size_in_bytes (TREE_TYPE (type));
} }
#endif
/* /*
* build a singleton array type, of TYPE objects. * build a singleton array type, of TYPE objects.
...@@ -564,7 +579,7 @@ digest_structure_tuple (type, inits) ...@@ -564,7 +579,7 @@ digest_structure_tuple (type, inits)
/* Return a Chill representation of the INTEGER_CST VAL. /* Return a Chill representation of the INTEGER_CST VAL.
The result may be in a static buffer, */ The result may be in a static buffer, */
char * const char *
display_int_cst (val) display_int_cst (val)
tree val; tree val;
{ {
...@@ -737,7 +752,8 @@ digest_array_tuple (type, init, allow_missing_elements) ...@@ -737,7 +752,8 @@ digest_array_tuple (type, init, allow_missing_elements)
if (! CH_COMPATIBLE (value, element_type)) if (! CH_COMPATIBLE (value, element_type))
{ {
char *err_val_name = first ? display_int_cst (first) : "(default)"; const char *err_val_name =
first ? display_int_cst (first) : "(default)";
error ("incompatible array tuple element %s", err_val_name); error ("incompatible array tuple element %s", err_val_name);
value = error_mark_node; value = error_mark_node;
} }
...@@ -779,7 +795,7 @@ digest_array_tuple (type, init, allow_missing_elements) ...@@ -779,7 +795,7 @@ digest_array_tuple (type, init, allow_missing_elements)
ptr = &TREE_CHAIN (*ptr); ptr = &TREE_CHAIN (*ptr);
if (*ptr && ! tree_int_cst_lt (CONSTRUCTOR_ELT_HI (*ptr), first)) if (*ptr && ! tree_int_cst_lt (CONSTRUCTOR_ELT_HI (*ptr), first))
{ {
char *err_val_name = display_int_cst (first); const char *err_val_name = display_int_cst (first);
error ("array tuple has duplicate index %s", err_val_name); error ("array tuple has duplicate index %s", err_val_name);
errors++; errors++;
continue; continue;
...@@ -862,7 +878,7 @@ digest_array_tuple (type, init, allow_missing_elements) ...@@ -862,7 +878,7 @@ digest_array_tuple (type, init, allow_missing_elements)
} }
else else
{ {
char *err_val_name = display_int_cst (first); const char *err_val_name = display_int_cst (first);
if (TREE_CODE (last) != INTEGER_CST) if (TREE_CODE (last) != INTEGER_CST)
error ("dynamic array tuple without (*) or (ELSE)"); error ("dynamic array tuple without (*) or (ELSE)");
else if (tree_int_cst_equal (first, last)) else if (tree_int_cst_equal (first, last))
......
...@@ -243,6 +243,18 @@ int result_never_set; ...@@ -243,6 +243,18 @@ int result_never_set;
static void pushdecllist PROTO((tree, int)); static void pushdecllist PROTO((tree, int));
static int init_nonvalue_struct PROTO((tree)); static int init_nonvalue_struct PROTO((tree));
static int init_nonvalue_array PROTO((tree)); static int init_nonvalue_array PROTO((tree));
static void set_nesting_level PROTO((tree, int));
static tree make_chill_variants PROTO((tree, tree, tree));
static tree fix_identifier PROTO((tree));
static void proclaim_decl PROTO((tree, int));
static tree maybe_acons PROTO((tree, tree));
static void push_scope_decls PROTO((int));
static void pop_scope_decls PROTO((tree, tree));
static tree build_implied_names PROTO((tree));
static void bind_sub_modules PROTO((int));
static void layout_array_type PROTO((tree));
static void do_based_decl PROTO((tree, tree, tree));
static void handle_one_level PROTO((tree, tree));
int current_nesting_level = BUILTIN_NESTING_LEVEL; int current_nesting_level = BUILTIN_NESTING_LEVEL;
int current_module_nesting_level = 0; int current_module_nesting_level = 0;
...@@ -406,7 +418,7 @@ tree string_ftype_ptr_ptr, int_ftype_string_string; ...@@ -406,7 +418,7 @@ tree string_ftype_ptr_ptr, int_ftype_string_string;
tree int_ftype_cptr_cptr_sizet; tree int_ftype_cptr_cptr_sizet;
#endif #endif
char **boolean_code_name; const char **boolean_code_name;
/* Two expressions that are constants with value zero. /* Two expressions that are constants with value zero.
The first is of type `int', the second of type `void *'. */ The first is of type `int', the second of type `void *'. */
...@@ -666,7 +678,7 @@ int warn_missing_braces; ...@@ -666,7 +678,7 @@ int warn_missing_braces;
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE, #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
char chill_tree_code_type[] = { const char chill_tree_code_type[] = {
'x', 'x',
#include "ch-tree.def" #include "ch-tree.def"
}; };
...@@ -689,7 +701,7 @@ int chill_tree_code_length[] = { ...@@ -689,7 +701,7 @@ int chill_tree_code_length[] = {
Used for printing out the tree and error messages. */ Used for printing out the tree and error messages. */
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME, #define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
char *chill_tree_code_name[] = { const char *chill_tree_code_name[] = {
"@@dummy", "@@dummy",
#include "ch-tree.def" #include "ch-tree.def"
}; };
...@@ -1038,7 +1050,7 @@ init_nonvalue_array (expr) ...@@ -1038,7 +1050,7 @@ init_nonvalue_array (expr)
/* This excessive piece of code sets DECL_NESTING_LEVEL (DECL) to LEVEL. */ /* This excessive piece of code sets DECL_NESTING_LEVEL (DECL) to LEVEL. */
void static void
set_nesting_level (decl, level) set_nesting_level (decl, level)
tree decl; tree decl;
int level; int level;
...@@ -1618,6 +1630,8 @@ struct tree_pair ...@@ -1618,6 +1630,8 @@ struct tree_pair
tree decl; tree decl;
}; };
static int label_value_cmp PROTO((struct tree_pair *,
struct tree_pair *));
/* Function to help qsort sort variant labels by value order. */ /* Function to help qsort sort variant labels by value order. */
static int static int
...@@ -1627,7 +1641,7 @@ label_value_cmp (x, y) ...@@ -1627,7 +1641,7 @@ label_value_cmp (x, y)
return TREE_INT_CST_LOW (x->value) - TREE_INT_CST_LOW (y->value); return TREE_INT_CST_LOW (x->value) - TREE_INT_CST_LOW (y->value);
} }
tree static tree
make_chill_variants (tagfields, body, variantelse) make_chill_variants (tagfields, body, variantelse)
tree tagfields; tree tagfields;
tree body; tree body;
...@@ -1809,7 +1823,8 @@ layout_chill_variants (utype) ...@@ -1809,7 +1823,8 @@ layout_chill_variants (utype)
{ {
int limit; int limit;
qsort (label_value_array, qsort (label_value_array,
label_index, sizeof (struct tree_pair), label_value_cmp); label_index, sizeof (struct tree_pair),
(int (*) PROTO ((const void *, const void *))) label_value_cmp);
limit = label_index - 1; limit = label_index - 1;
for (label_index = 0; label_index < limit; label_index++) for (label_index = 0; label_index < limit; label_index++)
{ {
...@@ -2035,7 +2050,8 @@ start_chill_function (label, rtype, parms, exceptlist, attrs) ...@@ -2035,7 +2050,8 @@ start_chill_function (label, rtype, parms, exceptlist, attrs)
{ {
/* We use the same name as the keyword. /* We use the same name as the keyword.
This makes it easy to print and change the RESULT from gdb. */ This makes it easy to print and change the RESULT from gdb. */
char *result_str = (ignore_case || ! special_UC) ? "result" : "RESULT"; const char *result_str =
(ignore_case || ! special_UC) ? "result" : "RESULT";
if (pass == 2 && TREE_CODE (result_type) == ERROR_MARK) if (pass == 2 && TREE_CODE (result_type) == ERROR_MARK)
TREE_TYPE (current_scope->remembered_decls) = result_type; TREE_TYPE (current_scope->remembered_decls) = result_type;
chill_result_decl = do_decl (get_identifier (result_str), chill_result_decl = do_decl (get_identifier (result_str),
...@@ -2331,14 +2347,14 @@ push_module (name, is_spec_module) ...@@ -2331,14 +2347,14 @@ push_module (name, is_spec_module)
return name; /* may have generated a name */ return name; /* may have generated a name */
} }
/* Make a copy of the identifier NAME, replacing each '!' by '__'. */ /* Make a copy of the identifier NAME, replacing each '!' by '__'. */
tree static tree
fix_identifier (name) fix_identifier (name)
tree name; tree name;
{ {
char *buf = (char*)alloca (2 * IDENTIFIER_LENGTH (name) + 1); char *buf = (char*)alloca (2 * IDENTIFIER_LENGTH (name) + 1);
int fixed = 0; int fixed = 0;
register char *dptr = buf; register char *dptr = buf;
register char *sptr = IDENTIFIER_POINTER (name); register const char *sptr = IDENTIFIER_POINTER (name);
for (; *sptr; sptr++) for (; *sptr; sptr++)
{ {
if (*sptr == '!') if (*sptr == '!')
...@@ -2492,7 +2508,7 @@ kept_level_p () ...@@ -2492,7 +2508,7 @@ kept_level_p ()
Check redefinitions at the same level. Check redefinitions at the same level.
Suppress error messages if QUIET is true. */ Suppress error messages if QUIET is true. */
void static void
proclaim_decl (decl, quiet) proclaim_decl (decl, quiet)
tree decl; tree decl;
int quiet; int quiet;
...@@ -2562,11 +2578,13 @@ struct path ...@@ -2562,11 +2578,13 @@ struct path
tree node; tree node;
}; };
static tree find_implied_types PROTO((tree, struct path *, tree));
/* Look for implied types (enumeral types) implied by TYPE (a decl or type). /* Look for implied types (enumeral types) implied by TYPE (a decl or type).
Add these to list. Add these to list.
Use old_path to guard against cycles. */ Use old_path to guard against cycles. */
tree static tree
find_implied_types (type, old_path, list) find_implied_types (type, old_path, list)
tree type; tree type;
struct path *old_path; struct path *old_path;
...@@ -3503,7 +3521,7 @@ init_decl_processing () ...@@ -3503,7 +3521,7 @@ init_decl_processing ()
sizetype = long_unsigned_type_node; sizetype = long_unsigned_type_node;
#else #else
{ {
char *size_type_c_name = SIZE_TYPE; const char *size_type_c_name = SIZE_TYPE;
if (strncmp (size_type_c_name, "long long ", 10) == 0) if (strncmp (size_type_c_name, "long long ", 10) == 0)
sizetype = long_long_unsigned_type_node; sizetype = long_long_unsigned_type_node;
else if (strncmp (size_type_c_name, "long ", 5) == 0) else if (strncmp (size_type_c_name, "long ", 5) == 0)
...@@ -3709,20 +3727,20 @@ init_decl_processing () ...@@ -3709,20 +3727,20 @@ init_decl_processing ()
DECL_SOURCE_LINE (temp) = 0; DECL_SOURCE_LINE (temp) = 0;
initializer_type = TREE_TYPE (temp); initializer_type = TREE_TYPE (temp);
bcopy (chill_tree_code_type, memcpy (tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE,
tree_code_type + (int) LAST_AND_UNUSED_TREE_CODE, chill_tree_code_type,
(((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE) (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
* sizeof (char))); * sizeof (char)));
bcopy ((char *) chill_tree_code_length, memcpy (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE,
(char *) (tree_code_length + (int) LAST_AND_UNUSED_TREE_CODE), chill_tree_code_length,
(((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE) (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
* sizeof (int))); * sizeof (int)));
bcopy ((char *) chill_tree_code_name, memcpy (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE,
(char *) (tree_code_name + (int) LAST_AND_UNUSED_TREE_CODE), chill_tree_code_name,
(((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE) (((int) LAST_CHILL_TREE_CODE - (int) LAST_AND_UNUSED_TREE_CODE)
* sizeof (char *))); * sizeof (char *)));
boolean_code_name = (char **) xmalloc (sizeof (char *) * (int) LAST_CHILL_TREE_CODE); boolean_code_name = (const char **) xcalloc (sizeof (char *),
bzero ((char *) boolean_code_name, sizeof (char *) * (int) LAST_CHILL_TREE_CODE); (int) LAST_CHILL_TREE_CODE);
boolean_code_name[EQ_EXPR] = "="; boolean_code_name[EQ_EXPR] = "=";
boolean_code_name[NE_EXPR] = "/="; boolean_code_name[NE_EXPR] = "/=";
...@@ -4268,10 +4286,10 @@ init_decl_processing () ...@@ -4268,10 +4286,10 @@ init_decl_processing ()
tree tree
builtin_function (name, type, function_code, library_name) builtin_function (name, type, function_code, library_name)
char *name; const char *name;
tree type; tree type;
enum built_in_function function_code; enum built_in_function function_code;
char *library_name; const char *library_name;
{ {
tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type); tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
DECL_EXTERNAL (decl) = 1; DECL_EXTERNAL (decl) = 1;
...@@ -4980,7 +4998,7 @@ save_expr_under_name (name, expr) ...@@ -4980,7 +4998,7 @@ save_expr_under_name (name, expr)
pushdecllist (alias, 0); pushdecllist (alias, 0);
} }
void static void
do_based_decl (name, mode, base_var) do_based_decl (name, mode, base_var)
tree name, mode, base_var; tree name, mode, base_var;
{ {
...@@ -5081,7 +5099,7 @@ static char exception_prefix [] = "__Ex_"; ...@@ -5081,7 +5099,7 @@ static char exception_prefix [] = "__Ex_";
tree tree
build_chill_exception_decl (name) build_chill_exception_decl (name)
char *name; const char *name;
{ {
tree decl, ex_name, ex_init, ex_type; tree decl, ex_name, ex_init, ex_type;
int name_len = strlen (name); int name_len = strlen (name);
...@@ -5142,7 +5160,7 @@ finish_outer_function () ...@@ -5142,7 +5160,7 @@ finish_outer_function ()
and fill in the module's function's address. */ and fill in the module's function's address. */
extern tree initializer_type; extern tree initializer_type;
char *fname_str = IDENTIFIER_POINTER (DECL_NAME (current_function_decl)); const char *fname_str = IDENTIFIER_POINTER (DECL_NAME (current_function_decl));
char *init_entry_name = (char *)xmalloc ((unsigned)(strlen (fname_str) + 20)); char *init_entry_name = (char *)xmalloc ((unsigned)(strlen (fname_str) + 20));
tree init_entry_id; tree init_entry_id;
tree init_entry_decl; tree init_entry_decl;
......
...@@ -62,6 +62,8 @@ static tree unlink_handler_decl; ...@@ -62,6 +62,8 @@ static tree unlink_handler_decl;
static int exceptions_initialized = 0; static int exceptions_initialized = 0;
static void emit_setup_handler PROTO((void)); static void emit_setup_handler PROTO((void));
static void initialize_exceptions PROTO((void)); static void initialize_exceptions PROTO((void));
static tree start_handler_array PROTO((void));
static void finish_handler_array PROTO((void));
static tree char_pointer_type_for_handler; static tree char_pointer_type_for_handler;
/* If this is 1, operations to push and pop on the __exceptionStack /* If this is 1, operations to push and pop on the __exceptionStack
......
...@@ -52,9 +52,43 @@ extern int special_UC; ...@@ -52,9 +52,43 @@ extern int special_UC;
#define HOURS_MAX 1193 #define HOURS_MAX 1193
#define DAYS_MAX 49 #define DAYS_MAX 49
/* forward declaration */ /* forward declarations */
rtx chill_expand_expr PROTO((tree, rtx, enum machine_mode, static rtx chill_expand_expr PROTO ((tree, rtx, enum machine_mode,
enum expand_modifier)); enum expand_modifier));
static tree chill_expand_case_expr PROTO ((tree));
static int check_arglist_length PROTO ((tree, int, int, tree));
static tree internal_build_compound_expr PROTO ((tree, int));
static int is_really_instance PROTO ((tree));
static int invalid_operand PROTO ((enum chill_tree_code,
tree, int));
static int invalid_right_operand PROTO ((enum chill_tree_code, tree));
static tree build_chill_abstime PROTO ((tree));
static tree build_allocate_memory_call PROTO ((tree, tree));
static tree build_allocate_global_memory_call PROTO ((tree, tree));
static tree build_return_memory PROTO ((tree));
static tree build_chill_duration PROTO ((tree, unsigned long,
tree, unsigned long));
static tree build_chill_floatcall PROTO ((tree, const char *,
const char *));
static tree build_allocate_getstack PROTO ((tree, tree, const char *,
const char *, tree, tree));
static tree build_chill_allocate PROTO ((tree, tree));
static tree build_chill_getstack PROTO ((tree, tree));
static tree build_chill_terminate PROTO ((tree));
static tree build_chill_inttime PROTO ((tree, tree));
static tree build_chill_lower_or_upper PROTO ((tree, int));
static tree build_max_min PROTO ((tree, int));
static tree build_chill_pred_or_succ PROTO ((tree, enum tree_code));
static tree expand_packed_set PROTO ((const char *, int, tree));
static tree fold_set_expr PROTO ((enum chill_tree_code,
tree, tree));
static tree build_compare_set_expr PROTO ((enum tree_code, tree, tree));
static tree scalar_to_string PROTO ((tree));
static tree build_concat_expr PROTO ((tree, tree));
static tree build_compare_string_expr PROTO ((enum tree_code, tree, tree));
static tree compare_records PROTO ((tree, tree));
static tree string_char_rep PROTO ((int, tree));
static tree build_boring_bitstring PROTO ((long, int));
/* variable to hold the type the DESCR built-in returns */ /* variable to hold the type the DESCR built-in returns */
static tree descr_type = NULL_TREE; static tree descr_type = NULL_TREE;
...@@ -84,7 +118,7 @@ force_addr_of (value) ...@@ -84,7 +118,7 @@ force_addr_of (value)
tree tree
check_have_mode (exp, context) check_have_mode (exp, context)
tree exp; tree exp;
char *context; const char *context;
{ {
if (TREE_CODE (exp) != ERROR_MARK && TREE_TYPE (exp) == NULL_TREE) if (TREE_CODE (exp) != ERROR_MARK && TREE_TYPE (exp) == NULL_TREE)
{ {
...@@ -134,7 +168,7 @@ check_case_selector_list (list) ...@@ -134,7 +168,7 @@ check_case_selector_list (list)
return nreverse(return_list); return nreverse(return_list);
} }
tree static tree
chill_expand_case_expr (expr) chill_expand_case_expr (expr)
tree expr; tree expr;
{ {
...@@ -208,7 +242,7 @@ chill_expand_case_expr (expr) ...@@ -208,7 +242,7 @@ chill_expand_case_expr (expr)
/* Hook used by expand_expr to expand CHILL-specific tree codes. */ /* Hook used by expand_expr to expand CHILL-specific tree codes. */
rtx static rtx
chill_expand_expr (exp, target, tmode, modifier) chill_expand_expr (exp, target, tmode, modifier)
tree exp; tree exp;
rtx target; rtx target;
...@@ -221,7 +255,7 @@ chill_expand_expr (exp, target, tmode, modifier) ...@@ -221,7 +255,7 @@ chill_expand_expr (exp, target, tmode, modifier)
rtx original_target = target; rtx original_target = target;
rtx op0, op1; rtx op0, op1;
int ignore = target == const0_rtx; int ignore = target == const0_rtx;
char *lib_func; /* name of library routine */ const char *lib_func; /* name of library routine */
if (ignore) if (ignore)
target = 0, original_target = 0; target = 0, original_target = 0;
...@@ -1189,7 +1223,7 @@ build_chill_abs (expr) ...@@ -1189,7 +1223,7 @@ build_chill_abs (expr)
return temp; return temp;
} }
tree static tree
build_chill_abstime (exprlist) build_chill_abstime (exprlist)
tree exprlist; tree exprlist;
{ {
...@@ -1242,7 +1276,7 @@ build_chill_abstime (exprlist) ...@@ -1242,7 +1276,7 @@ build_chill_abstime (exprlist)
} }
tree static tree
build_allocate_memory_call (ptr, size) build_allocate_memory_call (ptr, size)
tree ptr, size; tree ptr, size;
{ {
...@@ -1283,7 +1317,7 @@ build_allocate_memory_call (ptr, size) ...@@ -1283,7 +1317,7 @@ build_allocate_memory_call (ptr, size)
} }
tree static tree
build_allocate_global_memory_call (ptr, size) build_allocate_global_memory_call (ptr, size)
tree ptr, size; tree ptr, size;
{ {
...@@ -1324,7 +1358,7 @@ build_allocate_global_memory_call (ptr, size) ...@@ -1324,7 +1358,7 @@ build_allocate_global_memory_call (ptr, size)
} }
tree static tree
build_return_memory (ptr) build_return_memory (ptr)
tree ptr; tree ptr;
{ {
...@@ -1484,7 +1518,7 @@ build_chill_descr (expr) ...@@ -1484,7 +1518,7 @@ build_chill_descr (expr)
MILLISECS, SECS, MINUTES, HOURS and DAYS. MILLISECS, SECS, MINUTES, HOURS and DAYS.
The built duration value is in milliseconds. */ The built duration value is in milliseconds. */
tree static tree
build_chill_duration (expr, multiplier, fnname, maxvalue) build_chill_duration (expr, multiplier, fnname, maxvalue)
tree expr; tree expr;
unsigned long multiplier; unsigned long multiplier;
...@@ -1516,8 +1550,8 @@ build_chill_duration (expr, multiplier, fnname, maxvalue) ...@@ -1516,8 +1550,8 @@ build_chill_duration (expr, multiplier, fnname, maxvalue)
static tree static tree
build_chill_floatcall (expr, chillname, funcname) build_chill_floatcall (expr, chillname, funcname)
tree expr; tree expr;
char *chillname; const char *chillname;
char *funcname; const char *funcname;
{ {
tree result; tree result;
tree type; tree type;
...@@ -1545,8 +1579,8 @@ static tree ...@@ -1545,8 +1579,8 @@ static tree
build_allocate_getstack (mode, value, chill_name, fnname, filename, linenumber) build_allocate_getstack (mode, value, chill_name, fnname, filename, linenumber)
tree mode; tree mode;
tree value; tree value;
char *chill_name; const char *chill_name;
char *fnname; const char *fnname;
tree filename; tree filename;
tree linenumber; tree linenumber;
{ {
...@@ -1622,7 +1656,7 @@ build_allocate_getstack (mode, value, chill_name, fnname, filename, linenumber) ...@@ -1622,7 +1656,7 @@ build_allocate_getstack (mode, value, chill_name, fnname, filename, linenumber)
} }
/* process the ALLOCATE built-in */ /* process the ALLOCATE built-in */
tree static tree
build_chill_allocate (mode, value) build_chill_allocate (mode, value)
tree mode; tree mode;
tree value; tree value;
...@@ -1632,7 +1666,7 @@ build_chill_allocate (mode, value) ...@@ -1632,7 +1666,7 @@ build_chill_allocate (mode, value)
} }
/* process the GETSTACK built-in */ /* process the GETSTACK built-in */
tree static tree
build_chill_getstack (mode, value) build_chill_getstack (mode, value)
tree mode; tree mode;
tree value; tree value;
...@@ -1642,7 +1676,7 @@ build_chill_getstack (mode, value) ...@@ -1642,7 +1676,7 @@ build_chill_getstack (mode, value)
} }
/* process the TERMINATE built-in */ /* process the TERMINATE built-in */
tree static tree
build_chill_terminate (ptr) build_chill_terminate (ptr)
tree ptr; tree ptr;
{ {
...@@ -1686,7 +1720,7 @@ build_chill_inttime_type () ...@@ -1686,7 +1720,7 @@ build_chill_inttime_type ()
satisfy_decl (decl, 0); satisfy_decl (decl, 0);
} }
tree static tree
build_chill_inttime (t, loclist) build_chill_inttime (t, loclist)
tree t, loclist; tree t, loclist;
{ {
...@@ -1993,7 +2027,7 @@ build_max_min (expr, max_min) ...@@ -1993,7 +2027,7 @@ build_max_min (expr, max_min)
else else
{ {
tree parmlist, filename, lineno; tree parmlist, filename, lineno;
char *funcname; const char *funcname;
/* set up to call appropriate runtime function */ /* set up to call appropriate runtime function */
if (max_min) if (max_min)
...@@ -2479,7 +2513,7 @@ build_chill_function_call (function, expr) ...@@ -2479,7 +2513,7 @@ build_chill_function_call (function, expr)
if (valtail != 0 && TREE_VALUE (valtail) != void_type_node) if (valtail != 0 && TREE_VALUE (valtail) != void_type_node)
{ {
char *errstr = "too many arguments to procedure"; const char *errstr = "too many arguments to procedure";
if (name) if (name)
error ("%s `%s'", errstr, IDENTIFIER_POINTER (name)); error ("%s `%s'", errstr, IDENTIFIER_POINTER (name));
else else
...@@ -2488,7 +2522,7 @@ build_chill_function_call (function, expr) ...@@ -2488,7 +2522,7 @@ build_chill_function_call (function, expr)
} }
else if (typetail != 0 && TREE_VALUE (typetail) != void_type_node) else if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
{ {
char *errstr = "too few arguments to procedure"; const char *errstr = "too few arguments to procedure";
if (name) if (name)
error ("%s `%s'", errstr, IDENTIFIER_POINTER (name)); error ("%s `%s'", errstr, IDENTIFIER_POINTER (name));
else else
...@@ -2985,9 +3019,9 @@ build_generalized_call (func, args) ...@@ -2985,9 +3019,9 @@ build_generalized_call (func, args)
/* Given a set stored as one bit per char (in BUFFER[0 .. BIT_SIZE-1]), /* Given a set stored as one bit per char (in BUFFER[0 .. BIT_SIZE-1]),
return a CONTRUCTOR, of type TYPE (a SET_TYPE). */ return a CONTRUCTOR, of type TYPE (a SET_TYPE). */
tree static tree
expand_packed_set (buffer, bit_size, type) expand_packed_set (buffer, bit_size, type)
char *buffer; const char *buffer;
int bit_size; int bit_size;
tree type; tree type;
{ {
...@@ -3131,7 +3165,7 @@ build_compare_set_expr (code, op0, op1) ...@@ -3131,7 +3165,7 @@ build_compare_set_expr (code, op0, op1)
tree op0, op1; tree op0, op1;
{ {
tree result_type = NULL_TREE; tree result_type = NULL_TREE;
char *fnname; const char *fnname;
tree x; tree x;
/* These conversions are needed if -fold-strings. */ /* These conversions are needed if -fold-strings. */
...@@ -3428,7 +3462,7 @@ build_compare_string_expr (code, op0, op1) ...@@ -3428,7 +3462,7 @@ build_compare_string_expr (code, op0, op1)
return build (code, boolean_type_node, op0, op1); return build (code, boolean_type_node, op0, op1);
} }
tree static tree
compare_records (exp0, exp1) compare_records (exp0, exp1)
tree exp0, exp1; tree exp0, exp1;
{ {
...@@ -4017,7 +4051,7 @@ build_chill_arrow_expr (ref, force) ...@@ -4017,7 +4051,7 @@ build_chill_arrow_expr (ref, force)
tree tree
build_chill_addr_expr (ref, errormsg) build_chill_addr_expr (ref, errormsg)
tree ref; tree ref;
char *errormsg; const char *errormsg;
{ {
if (ref == error_mark_node) if (ref == error_mark_node)
return ref; return ref;
...@@ -4067,7 +4101,7 @@ build_chill_binary_op (code, op0, op1) ...@@ -4067,7 +4101,7 @@ build_chill_binary_op (code, op0, op1)
/* /*
* process a string repetition phrase '(' COUNT ')' STRING * process a string repetition phrase '(' COUNT ')' STRING
*/ */
tree static tree
string_char_rep (count, string) string_char_rep (count, string)
int count; int count;
tree string; tree string;
...@@ -4075,7 +4109,7 @@ string_char_rep (count, string) ...@@ -4075,7 +4109,7 @@ string_char_rep (count, string)
int slen, charindx, repcnt; int slen, charindx, repcnt;
char ch; char ch;
char *temp; char *temp;
char *inp; const char *inp;
char *outp; char *outp;
tree type; tree type;
...@@ -4102,7 +4136,7 @@ string_char_rep (count, string) ...@@ -4102,7 +4136,7 @@ string_char_rep (count, string)
/* Build a bit-string constant containing with the given LENGTH /* Build a bit-string constant containing with the given LENGTH
containing all ones (if VALUE is true), or all zeros (if VALUE is false). */ containing all ones (if VALUE is true), or all zeros (if VALUE is false). */
tree static tree
build_boring_bitstring (length, value) build_boring_bitstring (length, value)
long length; long length;
int value; int value;
......
...@@ -5,6 +5,14 @@ struct resword { ...@@ -5,6 +5,14 @@ struct resword {
enum toktype { RESERVED, DIRECTIVE, PREDEF } flags; enum toktype { RESERVED, DIRECTIVE, PREDEF } flags;
}; };
extern tree ridpointers []; extern tree ridpointers [];
#ifdef __GNUC__
__inline
#endif
static unsigned int hash PARAMS ((const char *, unsigned int));
#ifdef __GNUC__
__inline
#endif
struct resword *in_word_set PARAMS ((const char *, unsigned int));
%% %%
access, ACCESS, NORID, RESERVED access, ACCESS, NORID, RESERVED
after, AFTER, NORID, RESERVED after, AFTER, NORID, RESERVED
......
...@@ -58,7 +58,6 @@ int chill_at_module_level = 0; ...@@ -58,7 +58,6 @@ int chill_at_module_level = 0;
static int spec_module_generated = 0; static int spec_module_generated = 0;
/* define version strings */ /* define version strings */
extern char *gnuchill_version;
extern char *version_string; extern char *version_string;
/* define a faster string handling */ /* define a faster string handling */
...@@ -84,6 +83,34 @@ static MYSTRING *decode_constant_selective PROTO((tree, tree)); ...@@ -84,6 +83,34 @@ static MYSTRING *decode_constant_selective PROTO((tree, tree));
static MYSTRING *decode_mode_selective PROTO((tree, tree)); static MYSTRING *decode_mode_selective PROTO((tree, tree));
static MYSTRING *get_type_selective PROTO((tree, tree)); static MYSTRING *get_type_selective PROTO((tree, tree));
static MYSTRING *decode_decl_selective PROTO((tree, tree)); static MYSTRING *decode_decl_selective PROTO((tree, tree));
static MYSTRING *newstring PROTO((const char *));
static void strfree PROTO((MYSTRING *));
static MYSTRING *append PROTO((MYSTRING *, const char *));
static MYSTRING *prepend PROTO((MYSTRING *, const char *));
static void grant_use_seizefile PROTO((const char *));
static MYSTRING *decode_layout PROTO((tree));
static MYSTRING *grant_array_type PROTO((tree));
static MYSTRING *grant_array_type_selective PROTO((tree, tree));
static MYSTRING *get_tag_value PROTO((tree));
static MYSTRING *get_tag_value_selective PROTO((tree, tree));
static MYSTRING *print_enumeral PROTO((tree));
static MYSTRING *print_enumeral_selective PROTO((tree, tree));
static MYSTRING *print_integer_type PROTO((tree));
static tree find_enum_parent PROTO((tree, tree));
static MYSTRING *print_integer_selective PROTO((tree, tree));
static MYSTRING *print_struct PROTO((tree));
static MYSTRING *print_struct_selective PROTO((tree, tree));
static MYSTRING *print_proc_exceptions PROTO((tree));
static MYSTRING *print_proc_tail PROTO((tree, tree, int));
static MYSTRING *print_proc_tail_selective PROTO((tree, tree, tree));
static tree find_in_decls PROTO((tree, tree));
static int in_ridpointers PROTO((tree));
static void grant_seized_identifier PROTO((tree));
static void globalize_decl PROTO((tree));
static void grant_one_decl_selective PROTO((tree, tree));
static int compare_memory_file PROTO((const char *, const char *));
static int search_in_list PROTO((tree, tree));
static int really_grant_this PROTO((tree, tree));
/* list of the VAR_DECLs of the module initializer entries */ /* list of the VAR_DECLs of the module initializer entries */
tree module_init_list = NULL_TREE; tree module_init_list = NULL_TREE;
...@@ -101,7 +128,7 @@ static seizefile_list *selective_seizes = 0; ...@@ -101,7 +128,7 @@ static seizefile_list *selective_seizes = 0;
static MYSTRING * static MYSTRING *
newstring (str) newstring (str)
char *str; const char *str;
{ {
MYSTRING *tmp = (MYSTRING *) xmalloc (sizeof (MYSTRING)); MYSTRING *tmp = (MYSTRING *) xmalloc (sizeof (MYSTRING));
unsigned len = strlen (str); unsigned len = strlen (str);
...@@ -124,7 +151,7 @@ strfree (str) ...@@ -124,7 +151,7 @@ strfree (str)
static MYSTRING * static MYSTRING *
append (inout, in) append (inout, in)
MYSTRING *inout; MYSTRING *inout;
char *in; const char *in;
{ {
int inlen = strlen (in); int inlen = strlen (in);
int amount = ALLOCAMOUNT; int amount = ALLOCAMOUNT;
...@@ -141,7 +168,7 @@ append (inout, in) ...@@ -141,7 +168,7 @@ append (inout, in)
static MYSTRING * static MYSTRING *
prepend (inout, in) prepend (inout, in)
MYSTRING *inout; MYSTRING *inout;
char *in; const char *in;
{ {
MYSTRING *res = inout; MYSTRING *res = inout;
if (strlen (in)) if (strlen (in))
...@@ -153,9 +180,9 @@ prepend (inout, in) ...@@ -153,9 +180,9 @@ prepend (inout, in)
return res; return res;
} }
void static void
grant_use_seizefile (seize_filename) grant_use_seizefile (seize_filename)
char *seize_filename; const char *seize_filename;
{ {
APPEND (gstring, "<> USE_SEIZE_FILE \""); APPEND (gstring, "<> USE_SEIZE_FILE \"");
APPEND (gstring, seize_filename); APPEND (gstring, seize_filename);
...@@ -523,7 +550,7 @@ print_integer_type (type) ...@@ -523,7 +550,7 @@ print_integer_type (type)
{ {
MYSTRING *result = newstring (""); MYSTRING *result = newstring ("");
MYSTRING *mode_string; MYSTRING *mode_string;
char *name_ptr; const char *name_ptr;
tree base_type; tree base_type;
if (TREE_TYPE (type)) if (TREE_TYPE (type))
...@@ -1683,7 +1710,7 @@ decode_constant (init) ...@@ -1683,7 +1710,7 @@ decode_constant (init)
MYSTRING *tmp_string; MYSTRING *tmp_string;
tree type = TREE_TYPE (init); tree type = TREE_TYPE (init);
tree val = init; tree val = init;
char *op; const char *op;
char wrk[256]; char wrk[256];
MYSTRING *mode_string; MYSTRING *mode_string;
...@@ -1835,7 +1862,7 @@ decode_constant (init) ...@@ -1835,7 +1862,7 @@ decode_constant (init)
case STRING_CST: case STRING_CST:
{ {
char *ptr = TREE_STRING_POINTER (val); const char *ptr = TREE_STRING_POINTER (val);
int i = TREE_STRING_LENGTH (val); int i = TREE_STRING_LENGTH (val);
APPEND (result, "\""); APPEND (result, "\"");
while (--i >= 0) while (--i >= 0)
...@@ -2586,8 +2613,8 @@ grant_one_decl_selective (decl, all_decls) ...@@ -2586,8 +2613,8 @@ grant_one_decl_selective (decl, all_decls)
static int static int
compare_memory_file (fname, buf) compare_memory_file (fname, buf)
char *fname; const char *fname;
char *buf; const char *buf;
{ {
FILE *fb; FILE *fb;
int c; int c;
...@@ -2802,7 +2829,7 @@ really_grant_this (decl, granted_decls) ...@@ -2802,7 +2829,7 @@ really_grant_this (decl, granted_decls)
/* Write a SPEC MODULE using the declarations in the list DECLS. */ /* Write a SPEC MODULE using the declarations in the list DECLS. */
static int header_written = 0; static int header_written = 0;
static char *header_template = static const char *header_template =
"--\n-- WARNING: this file was generated by\n\ "--\n-- WARNING: this file was generated by\n\
-- GNUCHILL version %s\n-- based on gcc version %s\n--\n"; -- GNUCHILL version %s\n-- based on gcc version %s\n--\n";
......
...@@ -7,6 +7,14 @@ struct resword { ...@@ -7,6 +7,14 @@ struct resword {
enum toktype { RESERVED, DIRECTIVE, PREDEF } flags; enum toktype { RESERVED, DIRECTIVE, PREDEF } flags;
}; };
extern tree ridpointers []; extern tree ridpointers [];
#ifdef __GNUC__
__inline
#endif
static unsigned int hash PARAMS ((const char *, unsigned int));
#ifdef __GNUC__
__inline
#endif
struct resword *in_word_set PARAMS ((const char *, unsigned int));
/* maximum key range = 2815, duplicates = 6 */ /* maximum key range = 2815, duplicates = 6 */
#ifdef __GNUC__ #ifdef __GNUC__
......
...@@ -35,7 +35,26 @@ extern int ignore_case; ...@@ -35,7 +35,26 @@ extern int ignore_case;
/* set non-zero if special words are to be entered in uppercase */ /* set non-zero if special words are to be entered in uppercase */
extern int special_UC; extern int special_UC;
static int intsize_of_charsexpr PROTO((tree)); static int intsize_of_charsexpr PROTO ((tree));
static tree add_enum_to_list PROTO ((tree, tree));
static void build_chill_io_list_type PROTO ((void));
static void build_io_types PROTO ((void));
static void declare_predefined_file PROTO ((const char *, const char *));
static tree build_access_part PROTO ((void));
static tree textlocation_mode PROTO ((tree));
static int check_assoc PROTO ((tree, int, const char *));
static tree assoc_call PROTO ((tree, tree, const char *));
static int check_transfer PROTO ((tree, int, const char *));
static int connect_process_optionals PROTO ((tree, tree *, tree *, tree));
static tree connect_text PROTO ((tree, tree, tree, tree));
static tree connect_access PROTO ((tree, tree, tree, tree));
static int check_access PROTO ((tree, int, const char *));
static int check_text PROTO ((tree, int, const char *));
static tree get_final_type_and_range PROTO ((tree, tree *, tree *));
static void process_io_list PROTO ((tree, tree *, tree *, rtx *,
int, int));
static void check_format_string PROTO ((tree, tree, int));
static int get_max_size PROTO ((tree));
/* association mode */ /* association mode */
tree association_type_node; tree association_type_node;
...@@ -1047,8 +1066,8 @@ build_io_types () ...@@ -1047,8 +1066,8 @@ build_io_types ()
static void static void
declare_predefined_file (name, assembler_name) declare_predefined_file (name, assembler_name)
char *name; const char *name;
char* assembler_name; const char *assembler_name;
{ {
tree decl = build_lang_decl (VAR_DECL, get_identifier (name), tree decl = build_lang_decl (VAR_DECL, get_identifier (name),
stdio_type_node); stdio_type_node);
...@@ -1727,7 +1746,7 @@ static int ...@@ -1727,7 +1746,7 @@ static int
check_assoc (assoc, argnum, errmsg) check_assoc (assoc, argnum, errmsg)
tree assoc; tree assoc;
int argnum; int argnum;
char *errmsg; const char *errmsg;
{ {
if (assoc == NULL_TREE || TREE_CODE (assoc) == ERROR_MARK) if (assoc == NULL_TREE || TREE_CODE (assoc) == ERROR_MARK)
return 0; return 0;
...@@ -1860,7 +1879,7 @@ static tree ...@@ -1860,7 +1879,7 @@ static tree
assoc_call (assoc, func, name) assoc_call (assoc, func, name)
tree assoc; tree assoc;
tree func; tree func;
char *name; const char *name;
{ {
tree arg1, arg2, arg3; tree arg1, arg2, arg3;
tree result; tree result;
...@@ -2107,7 +2126,7 @@ static int ...@@ -2107,7 +2126,7 @@ static int
check_transfer (transfer, argnum, errmsg) check_transfer (transfer, argnum, errmsg)
tree transfer; tree transfer;
int argnum; int argnum;
char *errmsg; const char *errmsg;
{ {
int result = 0; int result = 0;
...@@ -2483,7 +2502,7 @@ static int ...@@ -2483,7 +2502,7 @@ static int
check_access (access, argnum, errmsg) check_access (access, argnum, errmsg)
tree access; tree access;
int argnum; int argnum;
char *errmsg; const char *errmsg;
{ {
if (access == NULL_TREE || TREE_CODE (access) == ERROR_MARK) if (access == NULL_TREE || TREE_CODE (access) == ERROR_MARK)
return 1; return 1;
...@@ -2719,7 +2738,7 @@ static int ...@@ -2719,7 +2738,7 @@ static int
check_text (text, argnum, errmsg) check_text (text, argnum, errmsg)
tree text; tree text;
int argnum; int argnum;
char *errmsg; const char *errmsg;
{ {
if (text == NULL_TREE || TREE_CODE (text) == ERROR_MARK) if (text == NULL_TREE || TREE_CODE (text) == ERROR_MARK)
return 0; return 0;
...@@ -3023,8 +3042,8 @@ process_io_list (exprlist, iolist_addr, iolist_length, iolist_rtx, do_read, ...@@ -3023,8 +3042,8 @@ process_io_list (exprlist, iolist_addr, iolist_length, iolist_rtx, do_read,
{ {
tree item = TREE_VALUE (exprlist); tree item = TREE_VALUE (exprlist);
tree idx = build_int_2 (idxcnt++, 0); tree idx = build_int_2 (idxcnt++, 0);
char *fieldname = 0; const char *fieldname = 0;
char *enumname = 0; const char *enumname = 0;
tree array_ref = build_chill_array_ref_1 (iolist, idx); tree array_ref = build_chill_array_ref_1 (iolist, idx);
tree item_type; tree item_type;
tree range_low = NULL_TREE, range_high = NULL_TREE; tree range_low = NULL_TREE, range_high = NULL_TREE;
...@@ -3788,6 +3807,9 @@ typedef enum ...@@ -3788,6 +3807,9 @@ typedef enum
} convcode_t; } convcode_t;
static convcode_t convcode; static convcode_t convcode;
static tree check_exprlist PROTO ((convcode_t, tree, int,
unsigned long));
typedef enum typedef enum
{ {
False, True, False, True,
...@@ -3822,6 +3844,9 @@ typedef enum { ...@@ -3822,6 +3844,9 @@ typedef enum {
NormalEnd, EndAtParen, TextFailEnd NormalEnd, EndAtParen, TextFailEnd
} formatexit_t; } formatexit_t;
static formatexit_t scanformcont PROTO ((char *, int, char **, int *,
tree, tree *, int, int *));
/* NOTE: varibale have to be set to False before calling check_format_string */ /* NOTE: varibale have to be set to False before calling check_format_string */
static Boolean empty_printed; static Boolean empty_printed;
......
...@@ -52,9 +52,12 @@ extern FILE* finput; ...@@ -52,9 +52,12 @@ extern FILE* finput;
extern int maximum_field_alignment; extern int maximum_field_alignment;
static int deep_const_expr PROTO ((tree));
static void chill_print_error_function PROTO ((const char *));
/* return 1 if the expression tree given has all /* return 1 if the expression tree given has all
constant nodes as its leaves; return 0 otherwise. */ constant nodes as its leaves; return 0 otherwise. */
int static int
deep_const_expr (exp) deep_const_expr (exp)
tree exp; tree exp;
{ {
...@@ -234,7 +237,7 @@ lang_decode_option (argc, argv) ...@@ -234,7 +237,7 @@ lang_decode_option (argc, argv)
return 1; return 1;
} }
void static void
chill_print_error_function (file) chill_print_error_function (file)
const char *file; const char *file;
{ {
......
...@@ -67,11 +67,11 @@ extern struct obstack permanent_obstack; ...@@ -67,11 +67,11 @@ extern struct obstack permanent_obstack;
extern struct obstack temporary_obstack; extern struct obstack temporary_obstack;
/* forward declarations */ /* forward declarations */
static void close_input_file PROTO((char *)); static void close_input_file PROTO((const char *));
static tree convert_bitstring PROTO((char *)); static tree convert_bitstring PROTO((char *));
static tree convert_integer PROTO((char *)); static tree convert_integer PROTO((char *));
static void maybe_downcase PROTO((char *)); static void maybe_downcase PROTO((char *));
static int maybe_number PROTO((char *)); static int maybe_number PROTO((const char *));
static tree equal_number PROTO((void)); static tree equal_number PROTO((void));
static void handle_use_seizefile_directive PROTO((int)); static void handle_use_seizefile_directive PROTO((int));
static int handle_name PROTO((tree)); static int handle_name PROTO((tree));
...@@ -82,7 +82,11 @@ static tree read_number PROTO((int)); ...@@ -82,7 +82,11 @@ static tree read_number PROTO((int));
static void skip_c_comment PROTO((void)); static void skip_c_comment PROTO((void));
static void skip_line_comment PROTO((void)); static void skip_line_comment PROTO((void));
static int skip_whitespace PROTO((void)); static int skip_whitespace PROTO((void));
static tree string_or_char PROTO((int, char *)); static tree string_or_char PROTO((int, const char *));
static void ch_lex_init PROTO((void));
static void skip_directive PROTO((void));
static int same_file PROTO((const char *, const char *));
static int getlc PROTO((FILE *));
/* next variables are public, because ch-actions uses them */ /* next variables are public, because ch-actions uses them */
...@@ -289,7 +293,8 @@ finish_parse () ...@@ -289,7 +293,8 @@ finish_parse ()
fclose (finput); fclose (finput);
} }
static int yywrap (); static int yywrap PROTO ((void));
static int yy_refill PROTO ((void));
#define YY_PUTBACK_SIZE 5 #define YY_PUTBACK_SIZE 5
#define YY_BUF_SIZE 1000 #define YY_BUF_SIZE 1000
...@@ -298,7 +303,8 @@ static char yy_buffer[YY_PUTBACK_SIZE + YY_BUF_SIZE]; ...@@ -298,7 +303,8 @@ static char yy_buffer[YY_PUTBACK_SIZE + YY_BUF_SIZE];
static char *yy_cur = yy_buffer + YY_PUTBACK_SIZE; static char *yy_cur = yy_buffer + YY_PUTBACK_SIZE;
static char *yy_lim = yy_buffer + YY_PUTBACK_SIZE; static char *yy_lim = yy_buffer + YY_PUTBACK_SIZE;
int yy_refill () static int
yy_refill ()
{ {
char *buf = yy_buffer + YY_PUTBACK_SIZE; char *buf = yy_buffer + YY_PUTBACK_SIZE;
int c, result; int c, result;
...@@ -593,7 +599,7 @@ yylex () ...@@ -593,7 +599,7 @@ yylex ()
static void static void
close_input_file (fn) close_input_file (fn)
char *fn; const char *fn;
{ {
if (finput == NULL) if (finput == NULL)
abort (); abort ();
...@@ -838,7 +844,7 @@ read_directive () ...@@ -838,7 +844,7 @@ read_directive ()
tree tree
build_chill_string (len, str) build_chill_string (len, str)
int len; int len;
char *str; const char *str;
{ {
tree t; tree t;
...@@ -855,7 +861,7 @@ build_chill_string (len, str) ...@@ -855,7 +861,7 @@ build_chill_string (len, str)
static tree static tree
string_or_char (len, str) string_or_char (len, str)
int len; int len;
char *str; const char *str;
{ {
tree result; tree result;
...@@ -890,7 +896,7 @@ maybe_downcase (str) ...@@ -890,7 +896,7 @@ maybe_downcase (str)
static int static int
maybe_number (s) maybe_number (s)
char *s; const char *s;
{ {
char fc; char fc;
...@@ -1349,11 +1355,11 @@ convert_bitstring (p) ...@@ -1349,11 +1355,11 @@ convert_bitstring (p)
static int static int
same_file (filename1, filename2) same_file (filename1, filename2)
char *filename1; const char *filename1;
char *filename2; const char *filename2;
{ {
struct stat s[2]; struct stat s[2];
char *fn_input[2]; const char *fn_input[2];
int i, stat_status; int i, stat_status;
if (grant_only_flag) if (grant_only_flag)
...@@ -1457,7 +1463,7 @@ handle_use_seizefile_directive (restricted) ...@@ -1457,7 +1463,7 @@ handle_use_seizefile_directive (restricted)
/* /*
* get input, convert to lower case for comparison * get input, convert to lower case for comparison
*/ */
int static int
getlc (file) getlc (file)
FILE *file; FILE *file;
{ {
...@@ -2104,7 +2110,7 @@ equal_number () ...@@ -2104,7 +2110,7 @@ equal_number ()
*/ */
void void
register_seize_path (path) register_seize_path (path)
char *path; const char *path;
{ {
int pathlen = strlen (path); int pathlen = strlen (path);
char *new_path = (char *)xmalloc (pathlen + 1); char *new_path = (char *)xmalloc (pathlen + 1);
......
...@@ -94,6 +94,4 @@ extern tree current_seize_file; ...@@ -94,6 +94,4 @@ extern tree current_seize_file;
extern int chill_at_module_level; extern int chill_at_module_level;
extern tree chill_initializer_name; extern tree chill_initializer_name;
extern void finish_chill_seizes ();
extern void prepare_paren_colon PROTO((void)); extern void prepare_paren_colon PROTO((void));
...@@ -41,8 +41,8 @@ static int initialize_iter_var PROTO((void)); ...@@ -41,8 +41,8 @@ static int initialize_iter_var PROTO((void));
static void maybe_skip_loop PROTO((void)); static void maybe_skip_loop PROTO((void));
static int bottom_loop_end_check PROTO((void)); static int bottom_loop_end_check PROTO((void));
static int increment_temps PROTO((void)); static int increment_temps PROTO((void));
static tree build_temporary_variable PROTO((char *, tree)); static tree build_temporary_variable PROTO((const char *, tree));
static tree maybe_make_for_temp PROTO((tree, char *, tree)); static tree maybe_make_for_temp PROTO((tree, const char *, tree));
#if 0 #if 0
static tree chill_unsigned_type PROTO((tree)); static tree chill_unsigned_type PROTO((tree));
#endif #endif
...@@ -1006,7 +1006,7 @@ top_loop_end_check (condition) ...@@ -1006,7 +1006,7 @@ top_loop_end_check (condition)
case DO_POWERSET: case DO_POWERSET:
{ {
tree temp1; tree temp1;
char *func_name; const char *func_name;
tree user_type = TREE_TYPE (ip->user_var); tree user_type = TREE_TYPE (ip->user_var);
if (ip->down_flag) if (ip->down_flag)
...@@ -1158,7 +1158,7 @@ increment_temps () ...@@ -1158,7 +1158,7 @@ increment_temps ()
*/ */
tree tree
get_unique_identifier (lead) get_unique_identifier (lead)
char *lead; const char *lead;
{ {
char idbuf [256]; char idbuf [256];
static int idcount = 0; static int idcount = 0;
...@@ -1174,7 +1174,7 @@ get_unique_identifier (lead) ...@@ -1174,7 +1174,7 @@ get_unique_identifier (lead)
*/ */
static tree static tree
build_temporary_variable (name, type) build_temporary_variable (name, type)
char *name; const char *name;
tree type; tree type;
{ {
return decl_temp1 (get_unique_identifier (name), type, 0, NULL_TREE, 0, 0); return decl_temp1 (get_unique_identifier (name), type, 0, NULL_TREE, 0, 0);
...@@ -1190,7 +1190,7 @@ build_temporary_variable (name, type) ...@@ -1190,7 +1190,7 @@ build_temporary_variable (name, type)
static tree static tree
maybe_make_for_temp (exp, temp_name, exp_type) maybe_make_for_temp (exp, temp_name, exp_type)
tree exp; tree exp;
char *temp_name; const char *temp_name;
tree exp_type; tree exp_type;
{ {
tree result = exp; tree result = exp;
......
...@@ -80,6 +80,18 @@ extern struct rtx_def *expand_expr PROTO((tree, struct rtx_def *, ...@@ -80,6 +80,18 @@ extern struct rtx_def *expand_expr PROTO((tree, struct rtx_def *,
enum machine_mode, int)); enum machine_mode, int));
static int parse_action PROTO((void)); static int parse_action PROTO((void));
static void ch_parse_init PROTO((void));
static void check_end_label PROTO((tree, tree));
static void end_function PROTO((void));
static tree build_prefix_clause PROTO((tree));
static enum terminal PEEK_TOKEN PROTO((void));
static int peek_token_ PROTO((int));
static void pushback_token PROTO((int, tree));
static void forward_token_ PROTO((void));
static void require PROTO((enum terminal));
static int check_token PROTO((enum terminal));
static int expect PROTO((enum terminal, const char *));
static void define__PROCNAME__ PROTO((void));
extern int lineno; extern int lineno;
extern char *input_filename; extern char *input_filename;
...@@ -226,7 +238,7 @@ build_prefix_clause (id) ...@@ -226,7 +238,7 @@ build_prefix_clause (id)
if (!id) if (!id)
{ {
if (current_module && current_module->name) if (current_module && current_module->name)
{ char *module_name = IDENTIFIER_POINTER (current_module->name); { const char *module_name = IDENTIFIER_POINTER (current_module->name);
if (module_name[0] && module_name[0] != '_') if (module_name[0] && module_name[0] != '_')
return current_module->name; return current_module->name;
} }
...@@ -315,7 +327,7 @@ forward_token_() ...@@ -315,7 +327,7 @@ forward_token_()
/* Skip the next token. /* Skip the next token.
if it isn't TOKEN, the parser is broken. */ if it isn't TOKEN, the parser is broken. */
void static void
require(token) require(token)
enum terminal token; enum terminal token;
{ {
...@@ -328,7 +340,7 @@ require(token) ...@@ -328,7 +340,7 @@ require(token)
FORWARD_TOKEN(); FORWARD_TOKEN();
} }
int static int
check_token (token) check_token (token)
enum terminal token; enum terminal token;
{ {
...@@ -341,10 +353,10 @@ check_token (token) ...@@ -341,10 +353,10 @@ check_token (token)
/* return 0 if expected token was not found, /* return 0 if expected token was not found,
else return 1. else return 1.
*/ */
int static int
expect(token, message) expect(token, message)
enum terminal token; enum terminal token;
char *message; const char *message;
{ {
if (PEEK_TOKEN() != token) if (PEEK_TOKEN() != token)
{ {
...@@ -363,7 +375,7 @@ expect(token, message) ...@@ -363,7 +375,7 @@ expect(token, message)
static void static void
define__PROCNAME__ () define__PROCNAME__ ()
{ {
char *fname; const char *fname;
tree string; tree string;
tree procname; tree procname;
...@@ -378,17 +390,114 @@ define__PROCNAME__ () ...@@ -378,17 +390,114 @@ define__PROCNAME__ ()
} }
/* Forward declarations. */ /* Forward declarations. */
static tree parse_expression (); static tree parse_expression PROTO((void));
static tree parse_primval (); static tree parse_primval PROTO((void));
static tree parse_mode PROTO((void)); static tree parse_mode PROTO((void));
static tree parse_opt_mode PROTO((void)); static tree parse_opt_mode PROTO((void));
static tree parse_untyped_expr (); static tree parse_untyped_expr PROTO((void));
static tree parse_opt_untyped_expr (); static tree parse_opt_untyped_expr PROTO((void));
static int parse_definition PROTO((int)); static int parse_definition PROTO((int));
static void parse_opt_actions (); static void parse_opt_actions PROTO((void));
static void parse_body PROTO((void)); static void parse_body PROTO((void));
static tree parse_if_expression_body PROTO((void)); static tree parse_if_expression_body PROTO((void));
static tree parse_opt_handler PROTO((void)); static tree parse_opt_handler PROTO((void));
static tree parse_opt_name_string PROTO((int));
static tree parse_simple_name_string PROTO((void));
static tree parse_name_string PROTO((void));
static tree parse_defining_occurrence PROTO((void));
static tree parse_name PROTO((void));
static tree parse_optlabel PROTO((void));
static void parse_opt_end_label_semi_colon PROTO((tree));
static void parse_modulion PROTO((tree));
static void parse_spec_module PROTO((tree));
static void parse_semi_colon PROTO((void));
static tree parse_defining_occurrence_list PROTO((void));
static void parse_mode_definition PROTO((int));
static void parse_mode_definition_statement PROTO((int));
static void parse_synonym_definition PROTO((void));
static void parse_synonym_definition_statement PROTO((void));
static tree parse_on_exception_list PROTO((void));
static void parse_on_alternatives PROTO((void));
static void parse_loc_declaration PROTO((int));
static void parse_declaration_statement PROTO((int));
static tree parse_optforbid PROTO((void));
static tree parse_postfix PROTO((enum terminal));
static tree parse_postfix_list PROTO((enum terminal));
static void parse_rename_clauses PROTO((enum terminal));
static tree parse_opt_prefix_clause PROTO((void));
static void parse_grant_statement PROTO((void));
static void parse_seize_statement PROTO((void));
static tree parse_param_name_list PROTO((void));
static tree parse_param_attr PROTO((void));
static tree parse_formpar PROTO((void));
static tree parse_formparlist PROTO((void));
static tree parse_opt_result_spec PROTO((void));
static tree parse_opt_except PROTO((void));
static tree parse_opt_recursive PROTO((void));
static tree parse_procedureattr PROTO((void));
static void parse_proc_body PROTO((tree, tree));
static void parse_procedure_definition PROTO((int));
static tree parse_processpar PROTO((void));
static tree parse_processparlist PROTO((void));
static void parse_process_definition PROTO((int));
static void parse_signal_definition PROTO((void));
static void parse_signal_definition_statement PROTO((void));
static void parse_then_clause PROTO((void));
static void parse_opt_else_clause PROTO((void));
static tree parse_expr_list PROTO((void));
static tree parse_range_list_clause PROTO((void));
static void pushback_paren_expr PROTO((tree));
static tree parse_case_label PROTO((void));
static tree parse_case_label_list PROTO((tree, int));
static tree parse_case_label_specification PROTO((tree));
static void parse_single_dimension_case_action PROTO((tree));
static void parse_multi_dimension_case_action PROTO((tree));
static void parse_case_action PROTO((tree));
static tree parse_asm_operands PROTO((void));
static tree parse_asm_clobbers PROTO((void));
static void ch_expand_asm_operands PROTO((tree, tree, tree, tree, int, char *, int));
static void parse_asm_action PROTO((void));
static void parse_begin_end_block PROTO((tree));
static void parse_if_action PROTO((tree));
static void parse_iteration PROTO((void));
static tree parse_delay_case_event_list PROTO((void));
static void parse_delay_case_action PROTO((tree));
static void parse_do_action PROTO((tree));
static tree parse_receive_spec PROTO((void));
static void parse_receive_case_action PROTO((tree));
static void parse_send_action PROTO((void));
static void parse_start_action PROTO((void));
static tree parse_call PROTO((tree));
static tree parse_tuple_fieldname_list PROTO((void));
static tree parse_tuple_element PROTO((void));
static tree parse_opt_element_list PROTO((void));
static tree parse_tuple PROTO((tree));
static tree parse_operand6 PROTO((void));
static tree parse_operand5 PROTO((void));
static tree parse_operand4 PROTO((void));
static tree parse_operand3 PROTO((void));
static tree parse_operand2 PROTO((void));
static tree parse_operand1 PROTO((void));
static tree parse_operand0 PROTO((void));
static tree parse_case_expression PROTO((void));
static tree parse_then_alternative PROTO((void));
static tree parse_else_alternative PROTO((void));
static tree parse_if_expression PROTO((void));
static tree parse_index_mode PROTO((void));
static tree parse_set_mode PROTO((void));
static tree parse_pos PROTO((void));
static tree parse_step PROTO((void));
static tree parse_opt_layout PROTO((int));
static tree parse_field_name_list PROTO((void));
static tree parse_fixed_field PROTO((void));
static tree parse_variant_field_list PROTO((void));
static tree parse_variant_alternative PROTO((void));
static tree parse_field PROTO((void));
static tree parse_structure_mode PROTO((void));
static tree parse_opt_queue_size PROTO((void));
static tree parse_procedure_mode PROTO((void));
static void parse_program PROTO((void));
static void parse_pass_1_2 PROTO((void));
static tree static tree
parse_opt_name_string (allow_all) parse_opt_name_string (allow_all)
...@@ -622,7 +731,7 @@ parse_mode_definition (is_newmode) ...@@ -622,7 +731,7 @@ parse_mode_definition (is_newmode)
ignoring = save_ignoring; ignoring = save_ignoring;
} }
void static void
parse_mode_definition_statement (is_newmode) parse_mode_definition_statement (is_newmode)
int is_newmode; int is_newmode;
{ {
...@@ -883,7 +992,7 @@ parse_declaration_statement (in_spec_module) ...@@ -883,7 +992,7 @@ parse_declaration_statement (in_spec_module)
parse_semi_colon (); parse_semi_colon ();
} }
tree static tree
parse_optforbid () parse_optforbid ()
{ {
if (check_token (FORBID) == 0) if (check_token (FORBID) == 0)
...@@ -905,7 +1014,7 @@ parse_optforbid () ...@@ -905,7 +1014,7 @@ parse_optforbid ()
/* Matches: <grant postfix> or <seize postfix> /* Matches: <grant postfix> or <seize postfix>
Returns: A (singleton) TREE_LIST. */ Returns: A (singleton) TREE_LIST. */
tree static tree
parse_postfix (grant_or_seize) parse_postfix (grant_or_seize)
enum terminal grant_or_seize; enum terminal grant_or_seize;
{ {
...@@ -921,7 +1030,7 @@ parse_postfix (grant_or_seize) ...@@ -921,7 +1030,7 @@ parse_postfix (grant_or_seize)
return build_tree_list (forbid, name); return build_tree_list (forbid, name);
} }
tree static tree
parse_postfix_list (grant_or_seize) parse_postfix_list (grant_or_seize)
enum terminal grant_or_seize; enum terminal grant_or_seize;
{ {
...@@ -931,7 +1040,7 @@ parse_postfix_list (grant_or_seize) ...@@ -931,7 +1040,7 @@ parse_postfix_list (grant_or_seize)
return list; return list;
} }
void static void
parse_rename_clauses (grant_or_seize) parse_rename_clauses (grant_or_seize)
enum terminal grant_or_seize; enum terminal grant_or_seize;
{ {
...@@ -972,7 +1081,7 @@ parse_opt_prefix_clause () ...@@ -972,7 +1081,7 @@ parse_opt_prefix_clause ()
return build_prefix_clause (parse_opt_name_string (0)); return build_prefix_clause (parse_opt_name_string (0));
} }
void static void
parse_grant_statement () parse_grant_statement ()
{ {
require (GRANT); require (GRANT);
...@@ -988,7 +1097,7 @@ parse_grant_statement () ...@@ -988,7 +1097,7 @@ parse_grant_statement ()
} }
} }
void static void
parse_seize_statement () parse_seize_statement ()
{ {
require (SEIZE); require (SEIZE);
...@@ -1282,7 +1391,7 @@ parse_process_definition (in_spec_module) ...@@ -1282,7 +1391,7 @@ parse_process_definition (in_spec_module)
ignoring = 0; ignoring = 0;
require (COLON); require (PROCESS); require (COLON); require (PROCESS);
expect (LPRN, "missing '(' after PROCESS"); expect (LPRN, "missing '(' after PROCESS");
params = parse_processparlist (in_spec_module); params = parse_processparlist ();
expect (RPRN, "missing ')' in PROCESS"); expect (RPRN, "missing ')' in PROCESS");
ignoring = save_ignoring; ignoring = save_ignoring;
if (in_spec_module) if (in_spec_module)
...@@ -1479,7 +1588,7 @@ parse_range_list_clause () ...@@ -1479,7 +1588,7 @@ parse_range_list_clause ()
return NULL_TREE; return NULL_TREE;
while (check_token (COMMA)) while (check_token (COMMA))
{ {
name = parse_name_string (0); name = parse_name_string ();
} }
if (check_token (SC)) if (check_token (SC))
{ {
...@@ -1899,7 +2008,7 @@ parse_asm_clobbers () ...@@ -1899,7 +2008,7 @@ parse_asm_clobbers ()
return list; return list;
} }
void static void
ch_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) ch_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line)
tree string, outputs, inputs, clobbers; tree string, outputs, inputs, clobbers;
int vol; int vol;
...@@ -4166,7 +4275,7 @@ parse_program() ...@@ -4166,7 +4275,7 @@ parse_program()
finish_outer_function (); finish_outer_function ();
} }
void static void
parse_pass_1_2() parse_pass_1_2()
{ {
parse_program(); parse_program();
......
...@@ -35,8 +35,12 @@ struct decl_chain ...@@ -35,8 +35,12 @@ struct decl_chain
tree decl; tree decl;
}; };
/* forward declaration */ /* forward declarations */
tree satisfy PROTO((tree, struct decl_chain *)); static tree satisfy PROTO ((tree, struct decl_chain *));
static void cycle_error_print PROTO ((struct decl_chain *, tree));
static tree safe_satisfy_decl PROTO ((tree, struct decl_chain *));
static void satisfy_list PROTO ((tree, struct decl_chain *));
static void satisfy_list_values PROTO ((tree, struct decl_chain *));
static struct decl_chain dummy_chain; static struct decl_chain dummy_chain;
#define LOOKUP_ONLY (chain==&dummy_chain) #define LOOKUP_ONLY (chain==&dummy_chain)
...@@ -55,7 +59,7 @@ cycle_error_print (chain, decl) ...@@ -55,7 +59,7 @@ cycle_error_print (chain, decl)
} }
} }
tree static tree
safe_satisfy_decl (decl, prev_chain) safe_satisfy_decl (decl, prev_chain)
tree decl; tree decl;
struct decl_chain *prev_chain; struct decl_chain *prev_chain;
...@@ -200,8 +204,7 @@ safe_satisfy_decl (decl, prev_chain) ...@@ -200,8 +204,7 @@ safe_satisfy_decl (decl, prev_chain)
case FUNCTION_DECL: case FUNCTION_DECL:
SATISFY (TREE_TYPE (decl)); SATISFY (TREE_TYPE (decl));
if (CH_DECL_PROCESS (decl)) if (CH_DECL_PROCESS (decl))
safe_satisfy_decl (DECL_TASKING_CODE_DECL (decl), safe_satisfy_decl ((tree) DECL_TASKING_CODE_DECL (decl), prev_chain);
prev_chain);
break; break;
case PARM_DECL: case PARM_DECL:
SATISFY (TREE_TYPE (decl)); SATISFY (TREE_TYPE (decl));
...@@ -211,8 +214,7 @@ safe_satisfy_decl (decl, prev_chain) ...@@ -211,8 +214,7 @@ safe_satisfy_decl (decl, prev_chain)
case TYPE_DECL: case TYPE_DECL:
SATISFY (TREE_TYPE (decl)); SATISFY (TREE_TYPE (decl));
if (CH_DECL_SIGNAL (decl)) if (CH_DECL_SIGNAL (decl))
safe_satisfy_decl (DECL_TASKING_CODE_DECL (decl), safe_satisfy_decl ((tree) DECL_TASKING_CODE_DECL (decl), prev_chain);
prev_chain);
if (!LOOKUP_ONLY) if (!LOOKUP_ONLY)
{ {
if (TYPE_NAME (TREE_TYPE (decl)) == NULL_TREE) if (TYPE_NAME (TREE_TYPE (decl)) == NULL_TREE)
...@@ -300,7 +302,7 @@ satisfy_list_values (exp, chain) ...@@ -300,7 +302,7 @@ satisfy_list_values (exp, chain)
} }
} }
tree static tree
satisfy (exp, chain) satisfy (exp, chain)
tree exp; tree exp;
struct decl_chain *chain; struct decl_chain *chain;
......
...@@ -44,8 +44,19 @@ tree generic_signal_type_node; ...@@ -44,8 +44,19 @@ tree generic_signal_type_node;
tree chill_taskingcode_type_node; tree chill_taskingcode_type_node;
/* forward declarations */ /* forward declarations */
void validate_process_parameters PROTO((tree)); #if 0
tree make_process_struct PROTO((tree, tree)); static void validate_process_parameters PROTO((tree));
static tree get_struct_variable_name PROTO((tree));
static tree decl_tasking_code_variable PROTO((tree, tree *, int));
#endif
static tree get_struct_debug_type_name PROTO((tree));
static tree get_process_wrapper_name PROTO((tree));
static tree build_tasking_enum PROTO((void));
static void build_tasking_message_type PROTO((void));
static tree build_receive_signal_case_label PROTO((tree, tree));
static tree build_receive_buffer_case_label PROTO((tree, tree));
static void build_receive_buffer_case_end PROTO((tree, tree));
static void build_receive_signal_case_end PROTO((tree, tree));
/* list of this module's process, buffer, etc. decls. /* list of this module's process, buffer, etc. decls.
This is a list of TREE_VECs, chain by their TREE_CHAINs. */ This is a list of TREE_VECs, chain by their TREE_CHAINs. */
...@@ -58,18 +69,18 @@ tree tasking_list = NULL_TREE; ...@@ -58,18 +69,18 @@ tree tasking_list = NULL_TREE;
#define TASK_INFO_STUFF_TYPE(NODE) TREE_VEC_ELT(NODE,4) #define TASK_INFO_STUFF_TYPE(NODE) TREE_VEC_ELT(NODE,4)
/* name template for process argument type */ /* name template for process argument type */
static char * struct_name = "__tmp_%s_arg_type"; static const char * struct_name = "__tmp_%s_arg_type";
/* name template for process arguments for debugging type */ /* name template for process arguments for debugging type */
static char * struct_debug_name = "__tmp_%s_debug_type"; static const char * struct_debug_name = "__tmp_%s_debug_type";
#if 0 #if 0
/* name template for process argument variable */ /* name template for process argument variable */
static char * data_name = "__tmp_%s_arg_variable"; static const char * data_name = "__tmp_%s_arg_variable";
#endif #endif
/* name template for process wrapper */ /* name template for process wrapper */
static char * wrapper_name = "__tmp_%s_wrapper"; static const char * wrapper_name = "__tmp_%s_wrapper";
extern int ignoring; extern int ignoring;
static tree void_ftype_void; static tree void_ftype_void;
...@@ -80,18 +91,18 @@ tree ...@@ -80,18 +91,18 @@ tree
get_struct_type_name (name) get_struct_type_name (name)
tree name; tree name;
{ {
char *idp = IDENTIFIER_POINTER (name); /* process name */ const char *idp = IDENTIFIER_POINTER (name); /* process name */
char *tmpname = xmalloc (strlen (idp) + strlen (struct_name) + 1); char *tmpname = xmalloc (strlen (idp) + strlen (struct_name) + 1);
sprintf (tmpname, struct_name, idp); sprintf (tmpname, struct_name, idp);
return get_identifier (tmpname); return get_identifier (tmpname);
} }
tree static tree
get_struct_debug_type_name (name) get_struct_debug_type_name (name)
tree name; tree name;
{ {
char *idp = IDENTIFIER_POINTER (name); /* process name */ const char *idp = IDENTIFIER_POINTER (name); /* process name */
char *tmpname = xmalloc (strlen (idp) + strlen (struct_debug_name) + 1); char *tmpname = xmalloc (strlen (idp) + strlen (struct_debug_name) + 1);
sprintf (tmpname, struct_debug_name, idp); sprintf (tmpname, struct_debug_name, idp);
...@@ -103,8 +114,8 @@ tree ...@@ -103,8 +114,8 @@ tree
get_tasking_code_name (name) get_tasking_code_name (name)
tree name; tree name;
{ {
char *skelname = "__tmp_%s_code"; const char *skelname = "__tmp_%s_code";
char *name_str = IDENTIFIER_POINTER (name); const char *name_str = IDENTIFIER_POINTER (name);
char *tmpname = (char *)alloca (IDENTIFIER_LENGTH (name) + char *tmpname = (char *)alloca (IDENTIFIER_LENGTH (name) +
strlen (skelname) + 1); strlen (skelname) + 1);
...@@ -117,7 +128,7 @@ static tree ...@@ -117,7 +128,7 @@ static tree
get_struct_variable_name (name) get_struct_variable_name (name)
tree name; tree name;
{ {
char *idp = IDENTIFIER_POINTER (name); /* process name */ const char *idp = IDENTIFIER_POINTER (name); /* process name */
char *tmpname = xmalloc (strlen (idp) + strlen (data_name) + 1); char *tmpname = xmalloc (strlen (idp) + strlen (data_name) + 1);
sprintf (tmpname, data_name, idp); sprintf (tmpname, data_name, idp);
...@@ -129,7 +140,7 @@ static tree ...@@ -129,7 +140,7 @@ static tree
get_process_wrapper_name (name) get_process_wrapper_name (name)
tree name; tree name;
{ {
char *idp = IDENTIFIER_POINTER (name); const char *idp = IDENTIFIER_POINTER (name);
char *tmpname = xmalloc (strlen (idp) + strlen (wrapper_name) + 1); char *tmpname = xmalloc (strlen (idp) + strlen (wrapper_name) + 1);
sprintf (tmpname, wrapper_name, idp); sprintf (tmpname, wrapper_name, idp);
...@@ -182,7 +193,8 @@ generate_tasking_code_variable (name, tasking_code_ptr, quasi_flag) ...@@ -182,7 +193,8 @@ generate_tasking_code_variable (name, tasking_code_ptr, quasi_flag)
* be initialized. The other module will do that. This is just * be initialized. The other module will do that. This is just
* for BUFFERs and EVENTs. * for BUFFERs and EVENTs.
*/ */
tree #if 0
static tree
decl_tasking_code_variable (name, tasking_code_ptr, quasi_flag) decl_tasking_code_variable (name, tasking_code_ptr, quasi_flag)
tree name, *tasking_code_ptr; tree name, *tasking_code_ptr;
int quasi_flag; int quasi_flag;
...@@ -223,6 +235,7 @@ decl_tasking_code_variable (name, tasking_code_ptr, quasi_flag) ...@@ -223,6 +235,7 @@ decl_tasking_code_variable (name, tasking_code_ptr, quasi_flag)
*tasking_code_ptr)); *tasking_code_ptr));
return decl; return decl;
} }
#endif
/* /*
* Transmute a process parameter list into an argument structure * Transmute a process parameter list into an argument structure
...@@ -492,11 +505,13 @@ build_process_wrapper (plabel, processdata) ...@@ -492,11 +505,13 @@ build_process_wrapper (plabel, processdata)
property" property"
*/ */
void #if 0
static void
validate_process_parameters (parms) validate_process_parameters (parms)
tree parms ATTRIBUTE_UNUSED; tree parms ATTRIBUTE_UNUSED;
{ {
} }
#endif
/* /*
* build the tree for a start process action. Loop through the * build the tree for a start process action. Loop through the
...@@ -612,7 +627,7 @@ build_start_process (process_name, copynum, ...@@ -612,7 +627,7 @@ build_start_process (process_name, copynum,
if (valtail != 0 && TREE_VALUE (valtail) != void_type_node) if (valtail != 0 && TREE_VALUE (valtail) != void_type_node)
{ {
char *errstr = "too many arguments to process"; const char *errstr = "too many arguments to process";
if (process_name) if (process_name)
error ("%s `%s'", errstr, IDENTIFIER_POINTER (process_name)); error ("%s `%s'", errstr, IDENTIFIER_POINTER (process_name));
else else
...@@ -620,7 +635,7 @@ build_start_process (process_name, copynum, ...@@ -620,7 +635,7 @@ build_start_process (process_name, copynum,
} }
else if (typetail != 0 && TREE_VALUE (typetail) != void_type_node) else if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
{ {
char *errstr = "too few arguments to process"; const char *errstr = "too few arguments to process";
if (process_name) if (process_name)
error ("%s `%s'", errstr, IDENTIFIER_POINTER (process_name)); error ("%s `%s'", errstr, IDENTIFIER_POINTER (process_name));
else else
...@@ -926,7 +941,7 @@ void ...@@ -926,7 +941,7 @@ void
add_taskstuff_to_list (code_decl, stufftype, stuffnumber, add_taskstuff_to_list (code_decl, stufftype, stuffnumber,
proc_decl, entry) proc_decl, entry)
tree code_decl; tree code_decl;
char *stufftype; const char *stufftype;
tree stuffnumber, proc_decl, entry; tree stuffnumber, proc_decl, entry;
{ {
if (pass == 1) if (pass == 1)
...@@ -1101,7 +1116,7 @@ build_queue_length (buf_ev) ...@@ -1101,7 +1116,7 @@ build_queue_length (buf_ev)
if (CH_IS_BUFFER_MODE (TREE_TYPE (buf_ev)) || if (CH_IS_BUFFER_MODE (TREE_TYPE (buf_ev)) ||
CH_IS_EVENT_MODE (TREE_TYPE (buf_ev))) CH_IS_EVENT_MODE (TREE_TYPE (buf_ev)))
{ {
char *field_name; const char *field_name;
tree arg1, arg2; tree arg1, arg2;
if (CH_IS_EVENT_MODE (TREE_TYPE (buf_ev))) if (CH_IS_EVENT_MODE (TREE_TYPE (buf_ev)))
...@@ -1217,7 +1232,7 @@ build_instance_type () ...@@ -1217,7 +1232,7 @@ build_instance_type ()
* *
#endif #endif
void static void
build_tasking_message_type () build_tasking_message_type ()
{ {
tree type_name; tree type_name;
......
...@@ -34,6 +34,8 @@ extern struct obstack permanent_obstack; ...@@ -34,6 +34,8 @@ extern struct obstack permanent_obstack;
to layout_chill_range_type for the index range of a string. */ to layout_chill_range_type for the index range of a string. */
tree string_index_type_dummy; tree string_index_type_dummy;
static tree make_powerset_type PROTO ((tree));
/* Build a chill string type. /* Build a chill string type.
For a character string, ELT_TYPE==char_type_node; For a character string, ELT_TYPE==char_type_node;
for a bit-string, ELT_TYPE==boolean_type_node. */ for a bit-string, ELT_TYPE==boolean_type_node. */
...@@ -88,7 +90,7 @@ build_string_type (elt_type, length) ...@@ -88,7 +90,7 @@ build_string_type (elt_type, length)
return t; return t;
} }
tree static tree
make_powerset_type (domain) make_powerset_type (domain)
tree domain; tree domain;
{ {
...@@ -156,7 +158,7 @@ build_bitstring_type (size_in_bits) ...@@ -156,7 +158,7 @@ build_bitstring_type (size_in_bits)
tree tree
get_identifier3 (part1, part2, part3) get_identifier3 (part1, part2, part3)
char *part1, *part2, *part3; const char *part1, *part2, *part3;
{ {
char *buf = (char*) char *buf = (char*)
alloca (strlen(part1) + strlen(part2) + strlen(part3) + 1); alloca (strlen(part1) + strlen(part2) + strlen(part3) + 1);
...@@ -173,7 +175,7 @@ build_alias_decl (old_prefix, new_prefix, postfix) ...@@ -173,7 +175,7 @@ build_alias_decl (old_prefix, new_prefix, postfix)
{ {
tree decl = make_node (ALIAS_DECL); tree decl = make_node (ALIAS_DECL);
char *postfix_pointer = IDENTIFIER_POINTER (postfix); const char *postfix_pointer = IDENTIFIER_POINTER (postfix);
int postfix_length = IDENTIFIER_LENGTH (postfix); int postfix_length = IDENTIFIER_LENGTH (postfix);
int old_length = old_prefix ? IDENTIFIER_LENGTH(old_prefix) : 0; int old_length = old_prefix ? IDENTIFIER_LENGTH(old_prefix) : 0;
int new_length = new_prefix ? IDENTIFIER_LENGTH(new_prefix) : 0; int new_length = new_prefix ? IDENTIFIER_LENGTH(new_prefix) : 0;
...@@ -234,7 +236,7 @@ tree ...@@ -234,7 +236,7 @@ tree
decl_check_rename (alias, old_name) decl_check_rename (alias, old_name)
tree alias, old_name; tree alias, old_name;
{ {
char *old_pointer = IDENTIFIER_POINTER (old_name); const char *old_pointer = IDENTIFIER_POINTER (old_name);
int old_len = IDENTIFIER_LENGTH (old_name); int old_len = IDENTIFIER_LENGTH (old_name);
if (DECL_OLD_PREFIX (alias)) if (DECL_OLD_PREFIX (alias))
{ {
......
...@@ -56,8 +56,15 @@ extern tree unsigned_intTI_type_node; ...@@ -56,8 +56,15 @@ extern tree unsigned_intTI_type_node;
/* forward declarations */ /* forward declarations */
static int chill_l_equivalent PROTO((tree, tree, struct mode_chain*)); static int chill_l_equivalent PROTO((tree, tree, struct mode_chain*));
static tree extract_constant_from_buffer PROTO((tree, unsigned char *, int)); static tree extract_constant_from_buffer PROTO((tree, const unsigned char *, int));
static int expand_constant_to_buffer PROTO((tree, unsigned char *, int)); static int expand_constant_to_buffer PROTO((tree, unsigned char *, int));
static tree build_empty_string PROTO((tree));
static tree make_chill_pointer_type PROTO((tree, enum tree_code));
static tree make_chill_range_type PROTO((tree, tree, tree));
static void apply_chill_array_layout PROTO((tree));
static int field_decl_cmp PROTO((tree *, tree*));
static tree make_chill_struct_type PROTO((tree));
static int apply_chill_field_layout PROTO((tree, int *));
/* /*
* This function checks an array access. * This function checks an array access.
...@@ -72,7 +79,7 @@ static int expand_constant_to_buffer PROTO((tree, unsigned char *, int)); ...@@ -72,7 +79,7 @@ static int expand_constant_to_buffer PROTO((tree, unsigned char *, int));
tree tree
valid_array_index_p (array, idx, error_message, is_varying_lhs) valid_array_index_p (array, idx, error_message, is_varying_lhs)
tree array, idx; tree array, idx;
char *error_message; const char *error_message;
int is_varying_lhs; int is_varying_lhs;
{ {
tree cond, low_limit, high_cond, atype, domain; tree cond, low_limit, high_cond, atype, domain;
...@@ -854,7 +861,7 @@ expand_constant_to_buffer (value, buffer, buf_size) ...@@ -854,7 +861,7 @@ expand_constant_to_buffer (value, buffer, buf_size)
static tree static tree
extract_constant_from_buffer (type, buffer, buf_size) extract_constant_from_buffer (type, buffer, buf_size)
tree type; tree type;
unsigned char *buffer; const unsigned char *buffer;
int buf_size; int buf_size;
{ {
tree value; tree value;
...@@ -1287,7 +1294,7 @@ tree ...@@ -1287,7 +1294,7 @@ tree
chill_expand_tuple (type, constructor) chill_expand_tuple (type, constructor)
tree type, constructor; tree type, constructor;
{ {
char *name; const char *name;
tree nonreft = type; tree nonreft = type;
if (TYPE_NAME (type) != NULL_TREE) if (TYPE_NAME (type) != NULL_TREE)
...@@ -2407,7 +2414,7 @@ build_chill_modify_expr (lhs, rhs) ...@@ -2407,7 +2414,7 @@ build_chill_modify_expr (lhs, rhs)
/* Construct, lay out and return the type of pointers to TO_TYPE. /* Construct, lay out and return the type of pointers to TO_TYPE.
If such a type has already been constructed, reuse it. */ If such a type has already been constructed, reuse it. */
tree static tree
make_chill_pointer_type (to_type, code) make_chill_pointer_type (to_type, code)
tree to_type; tree to_type;
enum tree_code code; /* POINTER_TYPE or REFERENCE_TYPE */ enum tree_code code; /* POINTER_TYPE or REFERENCE_TYPE */
...@@ -2494,7 +2501,7 @@ build_chill_reference_type (to_type) ...@@ -2494,7 +2501,7 @@ build_chill_reference_type (to_type)
return t; return t;
} }
tree static tree
make_chill_range_type (type, lowval, highval) make_chill_range_type (type, lowval, highval)
tree type, lowval, highval; tree type, lowval, highval;
{ {
...@@ -2994,7 +3001,7 @@ field_decl_cmp (x, y) ...@@ -2994,7 +3001,7 @@ field_decl_cmp (x, y)
return (long)DECL_NAME (*x) - (long)DECL_NAME (*y); return (long)DECL_NAME (*x) - (long)DECL_NAME (*y);
} }
tree static tree
make_chill_struct_type (fieldlist) make_chill_struct_type (fieldlist)
tree fieldlist; tree fieldlist;
{ {
...@@ -3302,7 +3309,8 @@ layout_chill_struct_type (t) ...@@ -3302,7 +3309,8 @@ layout_chill_struct_type (t)
for (x = fieldlist; x; x = TREE_CHAIN (x)) for (x = fieldlist; x; x = TREE_CHAIN (x))
field_array[len++] = x; field_array[len++] = x;
qsort (field_array, len, sizeof (tree), field_decl_cmp); qsort (field_array, len, sizeof (tree),
(int (*) PROTO ((const void *, const void *))) field_decl_cmp);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment