+Sun Sep 20 09:25:13 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (actions.o, convert.o, decl.o, expr.o, lang.o,
+ lex.o, loop.o, parse.o, satisfy.o, timing.o, tasking.o, tree.o,
+ typeck.o): Depend on system.h and toplev.h.
+ (except.o): Depend on toplev.h.
+ (grant.o): Depend on system.h, toplev.h and output.h.
+
+ * actions.c: Include system.h and toplev.h. Remove redundant
+ prototypes.
+ (build_cause_exception): Add default case in switch.
+ (update_else_range_for_range): Add parentheses around && within ||.
+ (chill_handle_multi_case_label_list): Remove unused variable
+ `selector_value'.
+ (print_missing_cases): Reconcile format specifiers vs arguments in
+ calls to sprintf.
+
+ * ch-tree.h: Don't include stdio.h. Wrap prototypes using FILE*
+ with macro BUFSIZ. Add missing prototypes.
+
+ * convert.c: Include system.h and toplev.h. Remove redundant
+ prototypes.
+ (convert): Remove unused variable `errstr'.
+
+ * decl.c: Include system.h and toplev.h. Remove redundant
+ prototypes.
+ (builtin_scope): Add missing initializers.
+ (clear_scope): Likewise.
+ (allocate_lang_decl): Mark parameter `t' with ATTRIBUTE_UNUSED.
+ (copy_lang_decl): Likewise for parameter `node'.
+ (c_decode_option): Likewise for parameter `argc'.
+ (push_extern_function): Likewise for parameter `granting'.
+ (switch_to_pass_2): Hide declaration of errorcount/sorrycount.
+ (pushdecl): Remove unused variable `t'.
+ (lookup_name_current_level): Make static and hide.
+ (lookup_name_for_seizing): Make static.
+ (finish_decl): Remove unused variable `type'.
+ (maybe_build_cleanup): Mark parameter `decl' with ATTRIBUTE_UNUSED.
+ (complete_array_type): Mark parameters `type', `initial_value' and
+ `do_default' with ATTRIBUTE_UNUSED.
+ (start_struct): Mark parameter `name' with ATTRIBUTE_UNUSED.
+ (start_enum): Likewise.
+ (shadow_record_fields): Remove unused variables `type' and `parent'.
+
+ * except.c: Include toplev.h. Remove redundant prototypes.
+
+ * expr.c: Include system.h and toplev.h. Don't define NULL.
+ Remove redundant prototypes.
+ (internal_build_compound_expr): Mark parameter `first_p' with
+ ATTRIBUTE_UNUSED.
+ (build_allocate_getstack): Remove unused variable `init'.
+ (build_chill_pred_or_succ): Likewise for variable `limit'.
+ (varying_to_slice): Likewise for variable `doamin' [sic].
+ (finish_chill_binary_op): Likewise for variables `code0' and
+ `code1'. Remove unused label `finish'. Add explicit braces to
+ avoid ambiguous `else'.
+ (build_chill_addr_expr): Remove extra parameter in call to `error'.
+ (build_chill_unary_op): Remove unused variables `class' and `type0'.
+ (powersetlen): Remove unused variables `domain' and `temp'.
+
+ * grant.c: Include system.h, toplev.h and output.h. Don't handle
+ strchr/strrchr. Remove redundant prototypes.
+ (decode_constant_selective): Remove unused variables `op' and `wrk'.
+ (push_granted): Mark parameters `name' and `decl' with
+ ATTRIBUTE_UNUSED.
+
+ * inout.c: Include system.h and toplev.h. Remove redundant
+ prototypes.
+ (textlocation_mode): Use &&, not &, when comparing two truth
+ values.
+ (scanformcont): Remove unused label `do_the_action'.
+
+ * lang.c: Include system.h and toplev.h. Remove redundant
+ prototypes.
+ (lookup_interface): Mark parameter `arg' with ATTRIBUTE_UNUSED.
+ (maybe_objc_comptypes): Likewise for parameters `lhs' and `rhs'.
+ (lang_print_xnode): Likewise for parameters `file', `node' and
+ `indent'.
+ (lang_decode_option): Explicitly declare `explicit_ignore_case'.
+ (incomplete_type_error): Mark parameters `value' and `type' with
+ ATTRIBUTE_UNUSED.
+
+ * lex.c: Include system.h and toplev.h. Remove redundant
+ prototypes. Don't handle strchr/strrchr. Use CAPITALIZED
+ versions of ctype macros from system.h. Cast ctype arguments to
+ unsigned char when necessary.
+ (last_token, RETURN_TOKEN): Hide definition.
+ (push_back): Remove unused function.
+ (readstring): Change variable `i' to unsigned.
+ (yywrap): Remove unused variable `node'.
+
+ * loop.c: Include system.h and toplev.h. Remove redundant
+ prototypes.
+ (chill_unsigned_type): Hide prototype and definition.
+ (begin_loop_scope): Remove unused variable `firstp'.
+ (nonvalue_begin_loop_scope): Likewise.
+
+ * parse.c: Include system.h and toplev.h. Remove redundant
+ prototypes.
+ (quasi_signal): Hide.
+ (PEEK_TOKEN): Change return type to `enum terminal'.
+ (parse_mode_definition_statement): Remove unused variable `names'.
+ (parse_formpar): Remove unused parameter `in_spec_module'. All
+ callers changed.
+ (parse_formparlist): Likewise.
+ (parse_processpar): Remove unused variable `parms'.
+ (parse_definition): Add explicit braces to avoid ambiguous `else'.
+ (parse_multi_dimension_case_action): Initialize variable
+ `begin_test_label'. Remove unused variable `new_test'.
+ (parse_case_action): Remove unused variable `caseaction_flag'.
+ (parse_asm_clobbers): Remove unused variable `expr'.
+ (parse_delay_case_action): Initialize variable `label_cnt'.
+ (parse_action): Make function static.
+ (parse_tuple_element): Remove unused variable `list'.
+ (parse_primval): Add default case in switch.
+ (parse_variant_alternative): Remove unused variables `x' and
+ `variant_fields'.
+
+ * satisfy.c: Include system.h and toplev.h. Remove redundant
+ prototypes.
+
+ * tasking.c Include system.h and toplev.h. Remove redundant
+ prototypes.
+ (data_name): Hide.
+ (get_struct_variable_name): Likewise.
+ (validate_process_parameters): Mark parameter `parms' with
+ ATTRIBUTE_UNUSED.
+ (build_start_process): Initialize variable `tuple'.
+ (build_receive_buffer_case_end): Remove unused variable `buffer_ptr'.
+
+ * timing.c: Include system.h and toplev.h.
+ (build_after_timeout_start): Remove unused variable `goto_where'.
+
+ * tree.c: Include system.h and toplev.h. Remove redundant
+ prototypes.
+
+ * typeck.c: Include system.h and toplev.h. Remove redundant
+ prototypes.
+ (extract_constant_from_buffer): Make function static. Add
+ explicit braces to avoid ambiguous `else'.
+ (expand_constant_to_buffer): Likewise.
+ (build_chill_slice): remove unused variable `is_static'.
+ (chill_compatible): Add explicit braces to avoid ambiguous `else'.
+ (apply_chill_array_layout): Remove unused variable `offset'.
+ (smash_dummy_type): Remove unused variable `save_lang_specific'.
+ (initializer_constant_valid_p): Add default case in switch.
+
Mon Sep 14 16:46:36 1998 Dave Brolley <brolley@cygnus.com>
* typeck.c (build_chill_slice): Always use TYPE_DOMAIN to get the
$(RM) gperf.tmp gperf.tmp2 sed.tmp
actions.o : actions.c $(CONFIG_H) $(CHILL_TREE_H) actions.h $(RTL_H) \
- lex.h $(srcdir)/../flags.h $(srcdir)/../../include/obstack.h $(srcdir)/../input.h $(srcdir)/../expr.h ../insn-codes.h
-convert.o : convert.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h $(srcdir)/../tree.h
-decl.o : decl.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h lex.h
-except.o : except.c $(CONFIG_H) $(srcdir)/../tree.h $(RTL_H) $(CHILL_TREE_H)
+ lex.h $(srcdir)/../flags.h $(srcdir)/../../include/obstack.h \
+ $(srcdir)/../input.h $(srcdir)/../expr.h ../insn-codes.h \
+ $(srcdir)/../system.h $(srcdir)/../toplev.h
+convert.o : convert.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
+ $(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h
+decl.o : decl.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h lex.h \
+ $(srcdir)/../system.h $(srcdir)/../toplev.h
+except.o : except.c $(CONFIG_H) $(srcdir)/../tree.h $(RTL_H) $(CHILL_TREE_H) \
+ $(srcdir)/../toplev.h
expr.o : expr.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
- $(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../tree.h lex.h
-grant.o: grant.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h $(srcdir)/../input.h \
- lex.h actions.h $(srcdir)/../input.h
-inout.o : inout.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h $(srcdir)/../input.h
-lang.o : lang.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../input.h lex.h
-lex.o : lex.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h $(srcdir)/../input.h \
- $(srcdir)/parse.h $(srcdir)/../../include/obstack.h lex.h
+ $(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../tree.h lex.h \
+ $(srcdir)/../system.h $(srcdir)/../toplev.h
+grant.o: grant.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
+ $(srcdir)/../input.h lex.h actions.h $(srcdir)/../system.h \
+ $(srcdir)/../toplev.h $(srcdir)/../output.h
+inout.o : inout.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
+ $(srcdir)/../input.h $(srcdir)/../system.h $(srcdir)/../toplev.h
+lang.o : lang.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../input.h lex.h \
+ $(srcdir)/../system.h $(srcdir)/../toplev.h
+lex.o : lex.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
+ $(srcdir)/../input.h $(srcdir)/parse.h $(srcdir)/../system.h \
+ $(srcdir)/../toplev.h $(srcdir)/../../include/obstack.h lex.h
lex.c: hash.h
loop.o : loop.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) lex.h \
$(srcdir)/../flags.h $(srcdir)/../input.h \
- $(srcdir)/../../include/obstack.h $(srcdir)/../tree.h
+ $(srcdir)/../../include/obstack.h $(srcdir)/../tree.h \
+ $(srcdir)/../system.h $(srcdir)/../toplev.h
parse.o : parse.c $(CONFIG_H) $(CHILL_TREE_H) parse.h \
- lex.h actions.h tasking.h
+ lex.h actions.h tasking.h $(srcdir)/../system.h $(srcdir)/../toplev.h
satisfy.o : satisfy.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../tree.h \
- $(srcdir)/../flags.h lex.h
+ $(srcdir)/../flags.h lex.h $(srcdir)/../system.h $(srcdir)/../toplev.h
timing.o : timing.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
- $(srcdir)/../input.h $(srcdir)/../../include/obstack.h lex.h
+ $(srcdir)/../input.h $(srcdir)/../../include/obstack.h lex.h \
+ $(srcdir)/../system.h $(srcdir)/../toplev.h
tasking.o : tasking.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) \
$(srcdir)/../flags.h $(srcdir)/../input.h \
- $(srcdir)/../../include/obstack.h lex.h
-tree.o : tree.c $(CONFIG_H) $(CHILL_TREE_H)
+ $(srcdir)/../../include/obstack.h lex.h $(srcdir)/../system.h \
+ $(srcdir)/../toplev.h
+tree.o : tree.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../system.h \
+ $(srcdir)/../toplev.h
typeck.o : typeck.c $(CONFIG_H) $(CHILL_TREE_H) ../insn-codes.h \
- $(srcdir)/../expr.h $(srcdir)/../flags.h lex.h
+ $(srcdir)/../expr.h $(srcdir)/../flags.h lex.h $(srcdir)/../system.h \
+ $(srcdir)/../toplev.h
ch-version.o : ch-version.c
ch-version.c : Makefile
echo 'char *gnuchill_version = "$(GNUCHILL_VERSION)";' > $@
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <stdio.h>
-#include <limits.h>
#include "config.h"
+#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "expr.h"
#include "actions.h"
#include "obstack.h"
#include "assert.h"
+#include "toplev.h"
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
extern int flag_short_enums;
extern int current_nesting_level;
-extern tree build_chill_compound_expr PROTO((tree));
-extern tree build_chill_exception_decl PROTO((char *));
-extern tree convert PROTO((tree, tree));
-extern rtx emit_line_note_force PROTO((char *, int));
-extern void error PROTO((char *, ...));
-extern void error_with_decl PROTO((tree, char *, ...));
-extern rtx gen_nop PROTO((void));
-extern tree get_identifier PROTO((char *));
-extern void pedwarn PROTO((char *, ...));
-extern void sorry PROTO((char *, ...));
-extern void warning PROTO((char *, ...));
-
extern struct obstack *expression_obstack, permanent_obstack;
extern struct obstack *current_obstack, *saveable_obstack;
if (lineno == NULL_TREE)
lineno = error_mark_node;
break;
+ default:
+ abort();
}
result =
build_chill_function_call (function,
{
low_range_val = TREE_INT_CST_LOW (TREE_PURPOSE (this_range));
high_range_val = TREE_INT_CST_LOW (TREE_VALUE (this_range));
- if (low_target_val >= low_range_val && low_target_val <= high_range_val
- || high_target_val >= low_range_val && high_target_val <= high_range_val)
+ if ((low_target_val >= low_range_val && low_target_val <= high_range_val)
+ || (high_target_val >= low_range_val && high_target_val <= high_range_val))
break;
prev_range = this_range;
}
chill_handle_multi_case_label_list (selector, labels)
tree selector, labels;
{
- tree one_label, selector_value, larg, rarg;
+ tree one_label, larg, rarg;
one_label = TREE_VALUE (labels);
larg = chill_handle_multi_case_label (selector, TREE_VALUE (one_label));
((ARRAY)[(unsigned)(INDEX) / HOST_BITS_PER_CHAR]\
|= 1 << ((unsigned)(INDEX) % HOST_BITS_PER_CHAR))
-extern HOST_WIDE_INT all_cases_count PROTO((tree, int*));
-extern void mark_seen_cases PROTO((tree, unsigned char*, long, int));
-
/* CASES_SEEN is a set (bitarray) of length COUNT.
For each element that is zero, print an error message,
assume the element have the given TYPE. */
break;
case CHAR_TYPE:
if ((x >= ' ' && x < 127) && x != '\'' && x != '^')
- sprintf (buf, "'%c'", x);
+ sprintf (buf, "'%c'", (char)x);
else
- sprintf (buf, "'^(%d)'", x);
+ sprintf (buf, "'^(%ld)'", x);
err_val_name = buf;
j = i;
while (j < count && !BITARRAY_TEST(cases_seen, j))
long y = x+j-i-1;
err_val_name += strlen (err_val_name);
if ((y >= ' ' && y < 127) && y != '\'' && y != '^')
- sprintf (err_val_name, "%s:'%c'", buf, y);
+ sprintf (err_val_name, "%s:'%c'", buf, (char)y);
else
- sprintf (err_val_name, "%s:'^(%d)'", buf, y);
+ sprintf (err_val_name, "%s:'^(%ld)'", buf, y);
i = j - 1;
}
break;
while (j < count && !BITARRAY_TEST(cases_seen, j))
j++;
if (j == i + 1)
- sprintf (buf, "%d", x);
+ sprintf (buf, "%ld", x);
else
- sprintf (buf, "%d:%d", x, x+j-i-1);
+ sprintf (buf, "%ld:%ld", x, x+j-i-1);
i = j - 1;
err_val_name = buf;
break;
#ifndef _CH_TREE_H
#define _CH_TREE_H
-#include <stdio.h>
-
/* Usage of TREE_LANG_FLAG_?:
1: TUPLE_NAMED_FIELD
" TYPE_FIELDS_READONLY (in ARRAY_TYPE, RECORD_TYPE or UNION_TYPE)
extern void constant_expression_warning PROTO((tree));
extern void decl_attributes PROTO((tree, tree));
extern void declare_function_name PROTO((void));
+#ifdef BUFSIZ
extern char *get_directive_line PROTO((FILE *));
+#endif
extern tree shorten_compare PROTO((tree *, tree *, tree *, enum tree_code *));
/* in c-decl.c */
extern void pending_xref_error PROTO((void));
extern void pop_chill_function_context PROTO((void));
extern tree poplevel PROTO((int, int, int));
+#ifdef BUFSIZ
extern void print_lang_decl PROTO((FILE *,tree, int));
extern void print_lang_identifier PROTO((FILE *,tree, int));
extern void print_lang_type PROTO((FILE *,tree, int));
+#endif
extern void push_chill_function_context PROTO((void));
extern void push_parm_decl PROTO((tree));
extern tree pushdecl PROTO((tree));
extern tree build_chill_card PROTO((tree));
extern tree build_chill_case_expr PROTO((tree, tree, tree));
extern tree build_cause_exception PROTO((tree, int));
+extern tree build_chill_exception_decl PROTO((char *));
extern tree build_chill_function_call PROTO((tree, tree));
extern tree build_chill_length PROTO((tree));
extern tree build_chill_indirect_ref PROTO((tree, tree, int));
extern tree chill_convert_for_assignment PROTO((tree, tree, char*));
extern void chill_expand_return PROTO((tree, int));
extern void chill_expand_result PROTO((tree, int));
+extern void chill_handle_case_default PROTO((void));
extern void chill_handle_case_label PROTO((tree, tree));
extern int chill_varying_string_type_p PROTO((tree));
extern int chill_varying_type_p PROTO((tree));
extern int ch_singleton_set PROTO((tree));
extern tree check_expression PROTO((tree, tree, tree));
+extern void check_missing_cases PROTO((tree));
extern tree check_non_null PROTO((tree));
extern tree check_range PROTO((tree, tree, tree,tree));
extern void cond_type_range_exception PROTO((tree));
extern tree do_decl 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 find_granted_decls PROTO((void));
extern void finish_chill_function PROTO(());
extern tree finish_enum PROTO((tree, tree));
extern void fixup_chill_parms PROTO((tree));
extern void finish_outer_function PROTO((void));
+extern unsigned get_type_precision PROTO((tree, tree));
extern tree grok_chill_fixedfields PROTO((tree, tree, tree));
extern tree grok_chill_variantdefs PROTO((tree, tree, tree));
+extern void layout_enum PROTO((tree));
/* extern tree lookup_remembered_decl PROTO((HOST_WIDE_INT, tree)); */
+extern void lookup_and_expand_goto PROTO((tree));
extern tree lookup_tag_fields PROTO((tree, tree));
+extern void lookup_and_handle_exit PROTO((tree));
extern tree massage_param_node PROTO((tree, tree));
extern void pop_module PROTO((void));
extern void print_mode PROTO((tree));
extern tree push_extern_function PROTO((tree, tree, tree, tree, int));
extern void push_extern_process PROTO((tree, tree, tree, int));
extern void push_extern_signal PROTO((tree, tree, tree));
+extern void push_granted PROTO((tree, tree));
extern tree push_modedef PROTO((tree, tree, int));
extern tree push_module PROTO((tree, int));
extern void push_parms PROTO((tree, tree, tree));
extern void push_syndecl PROTO((tree, tree, tree));
extern int result_never_set;
+extern void save_expr_under_name PROTO((tree, tree));
+extern tree set_module_name PROTO((tree));
extern int start_chill_function PROTO((tree, tree, tree, tree, tree));
extern void start_outer_function PROTO((void));
extern void switch_to_pass_2 PROTO((void));
/* in ch/except.c */
extern void chill_check_no_handlers PROTO((void));
+extern void chill_finish_on PROTO((void));
+extern void chill_handle_on_labels PROTO((tree));
extern void chill_reraise_exceptions PROTO((tree));
+extern void chill_start_default_handler PROTO((void));
+extern void chill_start_on PROTO((void));
+extern void expand_goto_except_cleanup PROTO((int));
+extern int is_handled PROTO((tree));
/* in ch/expr.c */
extern tree build_chill_addr_expr PROTO((tree, char *));
extern tree build_chill_arrow_expr PROTO((tree, int));
extern tree build_component_ref PROTO((tree, tree));
+extern tree build_chill_compound_expr PROTO((tree));
extern tree build_chill_descr PROTO((tree));
extern void build_chill_descr_type PROTO((void));
extern void build_chill_inttime_type PROTO((void));
extern void finish_chill_seize PROTO((tree));
extern void chill_grant PROTO((tree,tree, tree, tree));
extern void set_default_grant_file PROTO((void));
+extern void set_identifier_size PROTO((int));
extern void write_grant_file PROTO((void));
extern void write_spec_module PROTO((tree, tree));
extern tree build_chill_writeable PROTO((tree));
extern tree build_chill_writerecord PROTO((tree, tree));
extern tree build_chill_writetext PROTO((tree, tree));
+extern void build_enum_tables PROTO((void));
extern tree build_text_mode PROTO((tree, tree, int));
extern tree check_text_length PROTO((tree, tree));
extern void init_access_location PROTO((tree, tree));
extern tree make_process_struct PROTO((tree, tree));
extern tree make_signal_struct PROTO((tree));
extern tree max_queue_size PROTO((tree));
+extern void tasking_init PROTO((void));
+extern void tasking_registry PROTO((void));
+extern void tasking_setup PROTO((void));
/* in ch/timing.c */
extern tree abs_timing_type_node;
extern tree chill_resulting_mode PROTO((tree, tree));
extern int chill_similar PROTO((tree, tree, struct mode_chain*));
extern int discrete_type_p PROTO((tree));
+extern tree initializer_constant_valid_p PROTO((tree, tree));
extern tree convert_to_discrete PROTO((tree));
extern tree smash_dummy_type PROTO((tree));
extern tree string_assignment_condition PROTO((tree, tree));
but what kind of conversions it does will depend on the language. */
#include "config.h"
+#include "system.h"
#include "tree.h"
#include "ch-tree.h"
#include "flags.h"
#include "convert.h"
#include "lex.h"
+#include "toplev.h"
-extern void error PROTO((char *, ...));
-extern tree initializer_constant_valid_p PROTO((tree, tree));
extern tree bit_one_node, bit_zero_node;
extern tree string_one_type_node;
extern tree bitstring_one_type_node;
{
register tree e = expr;
register enum chill_tree_code code;
- char *errstr;
int type_varying;
if (e == NULL_TREE || TREE_CODE (e) == ERROR_MARK)
/* ??? not all decl nodes are given the most useful possible
line numbers. For example, the CONST_DECLs for enum values. */
-#include <stdio.h>
#include "config.h"
+#include "system.h"
#include "tree.h"
#include "flags.h"
#include "ch-tree.h"
#include "obstack.h"
#include "input.h"
#include "rtl.h"
+#include "toplev.h"
#define IS_UNKNOWN_TYPE(type) (TYPE_SIZE(type)==0)
#define BUILTIN_NESTING_LEVEL (-1)
extern tree signal_code;
extern int special_UC;
-extern void tasking_init PROTO((void));
-extern void error PROTO((char *, ...));
-extern void error_with_decl PROTO((tree, char *, ...));
-extern void expand_decl PROTO((tree));
static tree get_next_decl PROTO((void));
-extern tree get_parm_decls PROTO((void));
-extern void end_temporary_allocation PROTO((void));
-extern void indent_to PROTO((FILE *, int));
-#ifdef RTX_CODE
-extern rtx label_rtx PROTO((tree));
+static tree lookup_name_for_seizing PROTO((tree));
+#if 0
+static tree lookup_name_current_level PROTO((tree));
#endif
-extern tree lookup_name_for_seizing PROTO((tree));
-extern tree lookup_name_current_level PROTO((tree));
-extern int operand_equal_p PROTO((tree, tree, int));
-extern void pedwarn_with_decl PROTO((tree, char *, ...));
-extern void print_node PROTO((FILE *, char *, tree, int));
-extern void push_granted PROTO((tree, tree));
-extern void push_obstacks PROTO((struct obstack *, struct obstack *));
-extern void rest_of_decl_compilation PROTO((tree, char *, int, int));
-extern void sorry PROTO((char *, ...));
static void save_decl PROTO((tree));
-extern void start_identifier_warnings PROTO((void));
-extern void temporary_allocation PROTO((void));
-extern void warning PROTO((char *, ...));
extern struct obstack permanent_obstack;
extern int in_pseudo_module;
/* The outermost binding level, for pre-defined (builtin) names. */
-static struct scope builtin_scope = { NULL, NULL, NULL_TREE};
+static struct scope builtin_scope = {
+ NULL, NULL, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE,
+ NULL_TREE, NULL_TREE, NULL, 0, 0, NULL, NULL, NULL};
struct scope *global_scope;
/* Binding level structures are initialized by copying this one. */
-static struct scope clear_scope
- = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0};
+static struct scope clear_scope = {
+ NULL, NULL, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE, NULL_TREE,
+ NULL_TREE, NULL_TREE, NULL, 0, 0, NULL, NULL, NULL};
/* Chain of decls accessible through IDENTIFIER_OUTER_VALUE.
Decls with the same DECL_NAME are adjacent in the chain. */
static tree outer_decls = NULL_TREE;
-
-/* Forward declarations. */
-
-tree pushdecl ();
-tree builtin_function ();
-
-tree lookup_name_current_level ();
-static void layout_array_type ();
\f
/* C-specific option variables. */
\f
void
allocate_lang_decl (t)
- tree t;
+ tree t ATTRIBUTE_UNUSED;
{
/* Nothing needed */
}
void
copy_lang_decl (node)
- tree node;
+ tree node ATTRIBUTE_UNUSED;
{
/* Nothing needed */
}
int
c_decode_option (argc, argv)
- int argc;
+ int argc ATTRIBUTE_UNUSED;
char **argv;
{
char *p = argv[0];
*/
tree
push_extern_function (name, typespec, argtypes, exceptions, granting)
- tree name, typespec, argtypes, exceptions;
- int granting; /* If 0 do pushdecl(); if 1 do push_granted(). */
+ tree name, typespec, argtypes, exceptions;
+ int granting ATTRIBUTE_UNUSED;/*If 0 do pushdecl(); if 1 do push_granted()*/
{
tree ftype, fndecl;
void
switch_to_pass_2 ()
{
+#if 0
extern int errorcount, sorrycount;
+#endif
if (current_scope != &builtin_scope)
abort ();
last_scope = &builtin_scope;
pushdecl (x)
tree x;
{
- register tree t;
register tree name = DECL_NAME (x);
register struct scope *b = current_scope;
return val;
}
+#if 0
/* Similar to `lookup_name' but look only at current binding level. */
-tree
+static tree
lookup_name_current_level (name)
tree name;
{
return val;
return NULL_TREE;
}
+#endif
-tree
+static tree
lookup_name_for_seizing (seize_decl)
tree seize_decl;
{
finish_decl (decl)
tree decl;
{
- register tree type = TREE_TYPE (decl);
int was_incomplete = (DECL_SIZE (decl) == 0);
int temporary = allocation_temporary_p ();
tree
maybe_build_cleanup (decl)
- tree decl;
+ tree decl ATTRIBUTE_UNUSED;
{
/* There are no cleanups in C. */
return NULL_TREE;
int
complete_array_type (type, initial_value, do_default)
- tree type, initial_value;
- int do_default;
+ tree type ATTRIBUTE_UNUSED, initial_value ATTRIBUTE_UNUSED;
+ int do_default ATTRIBUTE_UNUSED;
{
/* Only needed so we can link with ../c-typeck.c. */
abort ();
tree
start_struct (code, name)
enum chill_tree_code code;
- tree name;
+ tree name ATTRIBUTE_UNUSED;
{
/* If there is already a tag defined at this binding level
(as a forward reference), just return it. */
tree
start_enum (name)
- tree name;
+ tree name ATTRIBUTE_UNUSED;
{
register tree enumtype;
shadow_record_fields (struct_val)
tree struct_val;
{
- tree type, parent;
-
if (pass == 1 || struct_val == NULL_TREE)
return;
#include "tree.h"
#include "ch-tree.h"
#include "rtl.h"
+#include "toplev.h"
/* On Suns this can get you to the right definition if you
set the right value for TARGET. */
#endif
extern int expand_exit_needed;
-extern tree build_chill_exception_decl PROTO((char *));
-extern void chill_handle_case_default PROTO((void));
-extern void emit_jump PROTO((rtx));
-extern void expand_decl PROTO((tree));
-extern void fatal PROTO((char *, ...));
-extern void make_decl_rtl PROTO((tree, char *, int));
-extern void rest_of_decl_compilation PROTO((tree, char *, int, int));
static tree link_handler_decl;
static tree handler_link_pointer_type;
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "tree.h"
#include "flags.h"
#include "assert.h"
#include "lex.h"
#include "convert.h"
-
-#ifndef NULL
-#define NULL 0
-#endif
+#include "toplev.h"
extern char **boolean_code_name;
extern int flag_old_strings;
extern int ignore_case;
extern int special_UC;
-extern void check_for_full_enumeration_handling PROTO((tree));
-extern void chill_handle_case_default PROTO((void));
-extern void error PROTO((char *, ...));
-extern void error_with_decl PROTO((tree, char *, ...));
-extern void fatal PROTO((char *, ...));
-extern void sorry PROTO((char *, ...));
-extern tree stabilize_reference PROTO((tree));
-extern void warning PROTO((char *, ...));
-
/* definitions for duration built-ins */
#define MILLISECS_MULTIPLIER 1
#define SECS_MULTIPLIER MILLISECS_MULTIPLIER * 1000
case SET_IN_EXPR:
{
- extern tree lookup_name PROTO((tree));
tree set = TREE_OPERAND (exp, 1);
tree pos = convert (long_unsigned_type_node, TREE_OPERAND (exp, 0));
tree set_type = TREE_TYPE (set);
case PACKED_ARRAY_REF:
{
- extern tree lookup_name PROTO((tree));
tree array = TREE_OPERAND (exp, 0);
tree pos = save_expr (TREE_OPERAND (exp, 1));
tree array_type = TREE_TYPE (array);
static tree
internal_build_compound_expr (list, first_p)
tree list;
- int first_p;
+ int first_p ATTRIBUTE_UNUSED;
{
register tree rest;
{
tree type, result;
tree expr = NULL_TREE;
- tree args, tmpvar, fncall, ptr, init, outlist = NULL_TREE;
+ tree args, tmpvar, fncall, ptr, outlist = NULL_TREE;
if (mode == NULL_TREE || TREE_CODE (mode) == ERROR_MARK)
return error_mark_node;
{
struct ch_class class;
tree etype, cond;
- tree limit;
if (pass == 1)
return NULL_TREE;
if (!chill_varying_type_p (TREE_TYPE (exp)))
return exp;
else
- { tree size, data, data_domain, doamin, min;
+ { tree size, data, data_domain, min;
tree novelty = CH_NOVELTY (TREE_TYPE (exp));
exp = save_if_needed (exp);
size = build_component_ref (exp, var_length_id);
tree op1 = check_have_mode (TREE_OPERAND (node, 1), "binary expression");
tree type0 = TREE_TYPE (op0);
tree type1 = TREE_TYPE (op1);
- enum tree_code code0;
- enum tree_code code1;
tree folded;
if (TREE_CODE (op0) == ERROR_MARK || TREE_CODE (op1) == ERROR_MARK)
return error_mark_node;
}
-
- finish:
if (TREE_TYPE (node) == NULL_TREE)
{
struct ch_class class;
TREE_CONSTANT (folded) = TREE_CONSTANT (op0) & TREE_CONSTANT (op1);
#endif
if (TREE_CODE (node) == TRUNC_DIV_EXPR)
- if (TREE_CONSTANT (op1))
- {
- if (tree_int_cst_equal (op1, integer_zero_node))
- {
- error ("division by zero");
- return integer_zero_node;
- }
- }
- else if (range_checking)
- {
+ {
+ if (TREE_CONSTANT (op1))
+ {
+ if (tree_int_cst_equal (op1, integer_zero_node))
+ {
+ error ("division by zero");
+ return integer_zero_node;
+ }
+ }
+ else if (range_checking)
+ {
#if 0
- tree test = build (EQ_EXPR, boolean_type_node, op1, integer_zero_node);
- /* Should this be overflow? */
- folded = check_expression (folded, test,
- ridpointers[(int) RID_RANGEFAIL]);
+ tree test =
+ build (EQ_EXPR, boolean_type_node, op1, integer_zero_node);
+ /* Should this be overflow? */
+ folded = check_expression (folded, test,
+ ridpointers[(int) RID_RANGEFAIL]);
#endif
- }
+ }
+ }
return folded;
}
\f
if (! CH_LOCATION_P (ref)
&& TREE_CODE (TREE_TYPE (ref)) != FUNCTION_TYPE)
{
- error ("ADDR parameter must be a LOCATION", errormsg);
+ error ("ADDR parameter must be a LOCATION");
return error_mark_node;
}
ref = build_chill_arrow_expr (ref, 1);
tree op0;
{
register tree result = NULL_TREE;
- struct ch_class class;
- tree type0 = TREE_TYPE (op0);
if (op0 == NULL_TREE || TREE_CODE (op0) == ERROR_MARK)
return error_mark_node;
powersetlen (powerset)
tree powerset;
{
- tree domain, temp;
-
if (powerset == NULL_TREE || TREE_CODE (powerset) == ERROR_MARK)
return error_mark_node;
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <stdio.h>
-#include <string.h>
-#include <limits.h>
#include "config.h"
+#include "system.h"
#include "tree.h"
#include "ch-tree.h"
#include "lex.h"
#include "flags.h"
#include "actions.h"
#include "input.h"
-#include "errno.h"
#include "rtl.h"
#include "tasking.h"
-
-/* Disable possible macro over-rides, so the externs parse
- portably. */
-#undef strchr
-#undef strrchr
+#include "toplev.h"
+#include "output.h"
#define APPEND(X,Y) X = append (X, Y)
#define PREPEND(X,Y) X = prepend (X, Y);
APPEND (X, ";\n"); \
} while (0)
-extern void assemble_constructor PROTO((char *));
-extern void assemble_name PROTO((FILE *, char *));
-extern void error PROTO((char *, ...));
-extern tree tasking_list;
-extern void tasking_registry PROTO((void));
-extern void tasking_setup PROTO((void));
-extern void build_enum_tables PROTO((void));
extern tree process_type;
-extern void warning PROTO((char *, ...));
-extern tree get_file_function_name PROTO((int));
extern char *asm_file_name;
extern char *dump_base_name;
MYSTRING *tmp_string;
tree type = TREE_TYPE (init);
tree val = init;
- char *op;
- char wrk[256];
MYSTRING *mode_string;
switch ((enum chill_tree_code)TREE_CODE (val))
p = gstring->str;
while (*p)
{
- extern char* strchr ();
p1 = strchr (p, '\n');
c = *++p1;
*p1 = '\0';
void
set_default_grant_file ()
{
-#undef strrchr
- extern char *strrchr ();
char *p, *tmp, *fname;
if (dump_base_name)
void
push_granted (name, decl)
- tree name, decl;
+ tree name ATTRIBUTE_UNUSED, decl ATTRIBUTE_UNUSED;
{
#if 0
IDENTIFIER_GRANTED_VALUE (name) = decl;
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <stdio.h>
-#include <string.h>
-#include <limits.h>
#include "config.h"
+#include "system.h"
#include "tree.h"
#include "ch-tree.h"
#include "rtl.h"
#include "flags.h"
#include "input.h"
#include "assert.h"
+#include "toplev.h"
/* set non-zero if input text is forced to lowercase */
extern int ignore_case;
/* set non-zero if special words are to be entered in uppercase */
extern int special_UC;
-extern void error PROTO((char *, ...));
-extern void sorry PROTO((char *, ...));
-extern void warning PROTO((char *, ...));
-
-extern tree build_chill_compound_expr PROTO((tree));
-
static int intsize_of_charsexpr PROTO((tree));
/* association mode */
field = TYPE_FIELDS (text);
for ( ; field != NULL_TREE; field = TREE_CHAIN (field))
{
- if (TREE_CODE (field) == FIELD_DECL &
+ if (TREE_CODE (field) == FIELD_DECL &&
DECL_NAME (field) == get_identifier ("tloc"))
return TREE_TYPE (field);
}
break;
}
- do_the_action: ;
state = FormatText;
break;
#include "config.h"
+#include "system.h"
#include "tree.h"
#include "ch-tree.h"
#include "lex.h"
-#include <stdio.h>
#include "input.h"
+#include "toplev.h"
/* Type node for boolean types. */
extern FILE* finput;
extern int maximum_field_alignment;
-
-extern void error PROTO((char *, ...));
-extern void error_with_decl PROTO((tree, char *, ...));
-extern void fatal PROTO((char *, ...));
-extern int floor_log2_wide PROTO((unsigned HOST_WIDE_INT));
-extern void pedwarn_with_decl PROTO((tree, char *, ...));
-extern void sorry PROTO((char *, ...));
-extern int type_hash_list PROTO((tree));
\f
/* return 1 if the expression tree given has all
constant nodes as its leaves; return 0 otherwise. */
/* Used by c-lex.c, but only for objc. */
tree
lookup_interface (arg)
- tree arg;
+ tree arg ATTRIBUTE_UNUSED;
{
return 0;
}
int
maybe_objc_comptypes (lhs, rhs)
- tree lhs, rhs;
+ tree lhs ATTRIBUTE_UNUSED, rhs ATTRIBUTE_UNUSED;
{
return -1;
}
void
lang_print_xnode (file, node, indent)
- FILE *file;
- tree node;
- int indent;
+ FILE *file ATTRIBUTE_UNUSED;
+ tree node ATTRIBUTE_UNUSED;
+ int indent ATTRIBUTE_UNUSED;
{
}
char **argv;
{
char *p = argv[0];
- static explicit_ignore_case = 0;
+ static int explicit_ignore_case = 0;
if (!strcmp(p, "-lang-chill"))
; /* do nothing */
else if (!strcmp (p, "-fruntime-checking"))
void
incomplete_type_error (value, type)
- tree value;
- tree type;
+ tree value ATTRIBUTE_UNUSED;
+ tree type ATTRIBUTE_UNUSED;
{
error ("internal error - use of undefined type");
}
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
\f
-#include <stdio.h>
-#include <errno.h>
+#include "config.h"
+#include "system.h"
#include <setjmp.h>
-#include <ctype.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include "config.h"
#include "tree.h"
#include "input.h"
#include "flags.h"
#include "parse.h"
#include "obstack.h"
+#include "toplev.h"
#ifdef MULTIBYTE_CHARS
-#include <stdlib.h>
#include <locale.h>
#endif
/* include the keyword recognizers */
#include "hash.h"
-#undef strchr
-
FILE* finput;
+#if 0
static int last_token = 0;
/* Sun's C compiler warns about the safer sequence
do { .. } while 0
when there's a 'return' inside the braces, so don't use it */
#define RETURN_TOKEN(X) { last_token = X; return (X); }
+#endif
/* This is set non-zero to force incoming tokens to lowercase. */
extern int ignore_case;
extern struct obstack permanent_obstack;
extern struct obstack temporary_obstack;
-#ifndef errno
-extern int errno;
-#endif
-
-extern tree build_string_type PROTO((tree, tree));
-extern void error PROTO((char *, ...));
-extern void error_with_file_and_line PROTO((char *, int, char *, ...));
-extern void grant_use_seizefile PROTO((char *));
-extern void pedwarn PROTO((char *, ...));
-extern void pfatal_with_name PROTO((char *));
-extern void push_obstacks PROTO((struct obstack *, struct obstack *));
-extern void set_identifier_size PROTO((int));
-extern void sorry PROTO((char *, ...));
-extern int target_isinf PROTO((REAL_VALUE_TYPE));
-extern int tolower PROTO((int));
-extern void warning PROTO((char *, ...));
-
/* forward declarations */
static void close_input_file PROTO((char *));
static tree convert_bitstring PROTO((char *));
static tree equal_number PROTO((void));
static void handle_use_seizefile_directive PROTO((int));
static int handle_name PROTO((tree));
-static void push_back PROTO((int));
static char *readstring PROTO((int, int *));
static void read_directive PROTO((void));
static tree read_identifier PROTO((int));
break;
if (ch == '_')
continue;
- if (!isxdigit (ch)) /* error on non-hex digit */
+ if (!ISXDIGIT (ch)) /* error on non-hex digit */
{
if (pass == 1)
error ("invalid C'xx' ");
for (;;)
{
ch = input ();
- if (isalnum (ch))
+ if (ISALNUM (ch))
obstack_1grow (&temporary_obstack, ch);
else if (ch != '_')
break;
case '.':
nextc = input ();
unput (nextc);
- if (isdigit (nextc)) /* || nextc == '_') we don't start numbers with '_' */
+ if (ISDIGIT (nextc)) /* || nextc == '_') we don't start numbers with '_' */
goto number;
return DOT;
case '0': case '1': case '2': case '3': case '4':
first = input ();
if (first == EOF)
break;
- if (! isalnum (first) && first != '_')
+ if (! ISALNUM (first) && first != '_')
{
unput (first);
break;
struct resword *tp;
tp = in_word_set (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
if (tp != NULL
- && special_UC == isupper (tp->name[0])
+ && special_UC == ISUPPER ((unsigned char) tp->name[0])
&& (tp->flags == RESERVED || tp->flags == PREDEF))
{
if (tp->rid != NORID)
if (ch != '_')
obstack_1grow (&temporary_obstack, ch);
ch = input ();
- if (! isdigit (ch) && ch != '_')
+ if (! ISDIGIT (ch) && ch != '_')
break;
}
if (ch == '.')
if (ch != '_')
obstack_1grow (&temporary_obstack, ch);
ch = input ();
- } while (isdigit (ch) || ch == '_');
+ } while (ISDIGIT (ch) || ch == '_');
is_float++;
}
if (ch == 'd' || ch == 'D' || ch == 'e' || ch == 'E')
obstack_1grow (&temporary_obstack, ch);
ch = input ();
}
- if (isdigit (ch) || ch == '_')
+ if (ISDIGIT (ch) || ch == '_')
{
do
{
if (ch != '_')
obstack_1grow (&temporary_obstack, ch);
ch = input ();
- } while (isdigit (ch) || ch == '_');
+ } while (ISDIGIT (ch) || ch == '_');
}
else
{
struct resword *tp;
tree id;
int ch = skip_whitespace();
- if (isalpha (ch) || ch == '_')
+ if (ISALPHA (ch) || ch == '_')
id = read_identifier (ch);
else if (ch == EOF)
{
return;
}
tp = in_word_set (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
- if (tp == NULL || special_UC != isupper (tp->name[0]))
+ if (tp == NULL || special_UC != ISUPPER ((unsigned char) tp->name[0]))
{
if (pass == 1)
warning ("unrecognized compiler directive `%s'",
return;
while (*str)
{
- if (isupper (*str))
+ if (ISUPPER ((unsigned char) *str))
*str = tolower (*str);
str++;
}
break;
case 'h':
case 'H':
- if (!isxdigit (*s))
+ if (!ISXDIGIT ((unsigned char) *s))
return 0;
break;
case 'b':
}
return 1;
}
-
-static void
-push_back (c)
-char c;
-{
- if (c == '\n')
- lineno--;
- unput (c);
-}
\f
static char *
readstring (terminator, len)
int c;
unsigned allocated = 1024;
char *tmp = xmalloc (allocated);
- int i = 0;
+ unsigned i = 0;
for (;;)
{
}
else if (base == 10)
{
- if (! isdigit (cc))
+ if (! ISDIGIT (cc))
cc = -1;
else
cc -= '0';
}
else if (base == 16)
{
- if (!isxdigit (cc))
+ if (!ISXDIGIT (cc))
cc = -1;
else
{
base = 2;
break;
default:
- if (!isdigit (*p)) /* this test is for equal_number () */
+ if (!ISDIGIT (*p)) /* this test is for equal_number () */
{
obstack_free (&temporary_obstack, intchars);
return 0;
struct stat s[2];
char *fn_input[2];
int i, stat_status;
- extern char *strchr();
if (grant_only_flag)
/* do nothing in this case */
register int c;
c = getc (file);
- if (isupper (c) && ignore_case)
+ if (ISUPPER (c) && ignore_case)
c = tolower (c);
return c;
}
it and ignore it; otherwise, ignore the line, with an error
if the word isn't `pragma', `ident', `define', or `undef'. */
- if (isupper (c) && ignore_case)
+ if (ISUPPER (c) && ignore_case)
c = tolower (c);
if (c >= 'a' && c <= 'z')
&& getlc (finput) == 'g'
&& getlc (finput) == 'm'
&& getlc (finput) == 'a'
- && (isspace (c = getlc (finput))))
+ && (c = getlc (finput), ISSPACE (c)))
{
#ifdef HANDLE_PRAGMA
static char buffer [128];
char * buff = buffer;
/* Read the pragma name into a buffer. */
- while (isspace (c = getlc (finput)))
+ while (c = getlc (finput), ISSPACE (c))
continue;
do
* buff ++ = c;
c = getlc (finput);
}
- while (c != EOF && ! isspace (c) && c != '\n'
+ while (c != EOF && ! ISSPACE (c) && c != '\n'
&& buff < buffer + 128);
pragma_ungetc (c);
&& getlc (finput) == 'i'
&& getlc (finput) == 'n'
&& getlc (finput) == 'e'
- && (isspace (c = getlc (finput))))
+ && (c = getlc (finput), ISSPACE (c)))
{
#if 0 /*def DWARF_DEBUGGING_INFO*/
if (c != '\n'
&& getlc (finput) == 'd'
&& getlc (finput) == 'e'
&& getlc (finput) == 'f'
- && (isspace (c = getlc (finput))))
+ && (c = getlc (finput), ISSPACE (c)))
{
#if 0 /*def DWARF_DEBUGGING_INFO*/
if (c != '\n'
/* Something follows the #; read a token. */
- if (isdigit(c))
+ if (ISDIGIT(c))
{
int old_lineno = lineno;
int used_up = 0;
{
l = l * 10 + (c - '0'); /* FIXME Not portable */
c = getlc(finput);
- } while (isdigit(c));
+ } while (ISDIGIT(c));
/* subtract one, because it is the following line that
gets the specified number */
/* `1' after file name means entering new file.
`2' after file name means just left a file. */
- if (isdigit (c))
+ if (ISDIGIT (c))
{
if (c == '1')
{
/* collect token into tokenbuf for later analysis */
while (TRUE)
{
- if (isspace (c) || c == '<')
+ if (ISSPACE (c) || c == '<')
break;
obstack_1grow (&temporary_obstack, c);
c = input ();
{
cursor = tokenbuf;
c = *cursor;
- if (!isalpha (c) && c != '_')
+ if (!ISALPHA (c) && c != '_')
{
if (pass == 1)
error ("invalid value follows `=' in compiler directive");
}
for (cursor = &tokenbuf[1]; *cursor != '\0'; cursor++)
- if (isalpha (*cursor) || *cursor == '_' || isdigit (*cursor))
+ if (ISALPHA ((unsigned char) *cursor) || *cursor == '_' ||
+ ISDIGIT (*cursor))
continue;
else
{
static int
yywrap ()
{
- extern char *strchr ();
extern char *chill_real_input_filename;
- tree node;
close_input_file (input_filename);
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <stdio.h>
-#include <limits.h>
#include "config.h"
+#include "system.h"
#include "tree.h"
#include "ch-tree.h"
#include "lex.h"
#include "obstack.h"
#include "assert.h"
#include "rtl.h"
+#include "toplev.h"
/* if the user codes '-flocal-loop-counter' on the command line,
ch-actions.c (lang_decode_option) will set this flag. */
int flag_local_loop_counter = 1;
-extern rtx emit_line_note PROTO((char *, int));
-extern void error PROTO((char *, ...));
-extern rtx expand_assignment PROTO((tree, tree, int, int));
-extern void save_expr_under_name PROTO((tree, tree));
-extern void stamp_nesting_label PROTO((tree));
-extern int int_fits_type_p PROTO((tree, tree));
-extern void warning PROTO((char *, ...));
-
/* forward declarations */
static int declare_temps PROTO((void));
static int initialize_iter_var PROTO((void));
static int increment_temps PROTO((void));
static tree build_temporary_variable PROTO((char *, tree));
static tree maybe_make_for_temp PROTO((tree, char *, tree));
+#if 0
static tree chill_unsigned_type PROTO((tree));
+#endif
\f
/* In terms of the parameters passed to build_loop_iterator,
* there are several types of loops. They are encoded by
void
begin_loop_scope ()
{
- ITERATOR *firstp = loopstack->iter_list;
-
pushlevel (1);
if (pass >= 2)
void
nonvalue_begin_loop_scope ()
{
- ITERATOR *firstp = loopstack->iter_list;
-
pushlevel (0); /* this happens only in pass 2 */
declare_temps ();
return result;
}
-
+#if 0
/*
* Adapt the C unsigned_type function to CHILL - we need to
* account for any CHILL-specific integer types here. So far,
else
return unsigned_type (type);
}
+#endif
* Then code is generated.
*/
-#include <stdio.h>
#include "config.h"
+#include "system.h"
#include "tree.h"
#include "ch-tree.h"
#include "lex.h"
#include "actions.h"
#include "tasking.h"
#include "parse.h"
+#include "toplev.h"
/* Since parsers are distinct for each language, put the
language string definition here. (fnf) */
/* Cause the `yydebug' variable to be defined. */
#define YYDEBUG 1
-extern void assemble_external PROTO((tree));
-extern void chill_check_no_handlers PROTO((void));
-extern void chill_finish_on PROTO((void));
-extern void chill_handle_case_default PROTO((void));
-extern void chill_handle_on_labels PROTO((tree));
-extern tree chill_initializer_constant_valid_p PROTO((tree, tree));
-extern void chill_start_default_handler PROTO((void));
-extern void chill_start_on PROTO((void));
-extern struct rtx_def* emit_line_note PROTO((char *, int));
extern struct rtx_def* gen_label_rtx PROTO((void));
extern void emit_jump PROTO((struct rtx_def *));
extern void emit_label PROTO((struct rtx_def *));
-extern void error PROTO((char *, ...));
-extern int expand_exit_labelled PROTO((tree));
-extern void lookup_and_expand_goto PROTO((tree));
-extern void lookup_and_handle_exit PROTO((tree));
-extern void push_granted PROTO((tree, tree));
-extern void sorry PROTO((char *, ...));
-extern void warning PROTO((char *, ...));
+static int parse_action PROTO((void));
extern int lineno;
extern char *input_filename;
extern int all_static_flag;
extern int ignore_case;
+#if 0
static int quasi_signal = 0; /* 1 if processing a quasi signal decl */
+#endif
int parsing_newmode; /* 0 while parsing SYNMODE;
1 while parsing NEWMODE. */
#ifdef __GNUC__
__inline__
#endif
-static int
+static enum terminal
PEEK_TOKEN()
{
if (terminal_buffer[0] == TOKEN_NOT_READ)
parse_semi_colon ();
}
-extern tree set_module_name ();
-
static void
parse_modulion (label)
tree label;
parse_mode_definition_statement (is_newmode)
int is_newmode;
{
- tree names;
FORWARD_TOKEN (); /* skip SYNMODE or NEWMODE */
parse_mode_definition (is_newmode);
while (PEEK_TOKEN () == COMMA)
/* In pass 1, returns list of types; in pass 2: chain of PARM_DECLs. */
static tree
-parse_formpar (in_spec_module)
- int in_spec_module;
+parse_formpar ()
{
tree names = parse_param_name_list ();
tree mode = parse_mode ();
* also need change. Push_extern_process is affected as well.
*/
static tree
-parse_formparlist (in_spec_module)
- int in_spec_module;
+parse_formparlist ()
{
tree list = NULL_TREE;
if (PEEK_TOKEN() == RPRN)
return NULL_TREE;
for (;;)
{
- list = chainon (list, parse_formpar (in_spec_module));
+ list = chainon (list, parse_formpar ());
if (! check_token (COMMA))
break;
}
ignoring = pass == 2;
require (COLON); require (PROC);
expect (LPRN, "missing '(' after PROC");
- params = parse_formparlist (in_spec_module);
+ params = parse_formparlist ();
expect (RPRN, "missing ')' in PROC");
result = parse_opt_result_spec ();
exceptlist = parse_opt_except ();
tree names = parse_defining_occurrence_list ();
tree mode = parse_mode ();
tree paramattr = parse_param_attr ();
- tree parms = NULL_TREE;
+
if (names && TREE_CODE (names) == IDENTIFIER_NODE)
names = build_tree_list (NULL_TREE, names);
return tree_cons (tree_cons (paramattr, mode, NULL_TREE), names, NULL_TREE);
{
case NAME:
if (PEEK_TOKEN1() == COLON)
- if (PEEK_TOKEN2() == PROC)
- {
- parse_procedure_definition (in_spec_module);
- return 1;
- }
- else if (PEEK_TOKEN2() == PROCESS)
- {
- parse_process_definition (in_spec_module);
- return 1;
- }
+ {
+ if (PEEK_TOKEN2() == PROC)
+ {
+ parse_procedure_definition (in_spec_module);
+ return 1;
+ }
+ else if (PEEK_TOKEN2() == PROCESS)
+ {
+ parse_process_definition (in_spec_module);
+ return 1;
+ }
+ }
return 0;
case DCL:
parse_declaration_statement(in_spec_module);
parse_multi_dimension_case_action (selector)
tree selector;
{
- struct rtx_def *begin_test_label, *end_case_label, *new_label;
+ struct rtx_def *begin_test_label = 0, *end_case_label, *new_label;
tree action_labels = NULL_TREE;
tree tests = NULL_TREE;
- tree new_test;
int save_lineno = lineno;
char *save_filename = input_filename;
tree selector;
int multi_dimension_case = 0;
-/* The case label/action toggle. It is 0 initially, and when an action
- was last seen. It is 1 integer_zero_node when a label was last seen. */
- int caseaction_flag = 0;
-
require (CASE);
selector = parse_expr_list ();
selector = nreverse (selector);
tree list = NULL_TREE;
for (;;)
{
- tree string, expr;
+ tree string;
if (PEEK_TOKEN () != STRING)
{
error ("bad ASM operand");
parse_delay_case_action (label)
tree label;
{
- tree label_cnt, set_location, priority;
+ tree label_cnt = NULL_TREE, set_location, priority;
tree combined_event_list = NULL_TREE;
require (DELAY);
require (CASE);
while (parse_action ()) ;
}
-int
+static int
parse_action ()
{
tree label = NULL_TREE;
{
/* The tupleelement chain is built in reverse order,
and put in forward order when the list is used. */
- tree value, list, label;
+ tree value, label;
if (PEEK_TOKEN () == DOT)
{
/* Parse a labelled structure tuple. */
args = parse_primval ();
val = ignoring ? val : build_generalized_call (val, args);
continue;
+ default:
+ break;
}
break;
}
static tree
parse_variant_alternative ()
{
- tree labels, x;
- tree variant_fields = NULL_TREE;
+ tree labels;
+
if (PEEK_TOKEN () == LPRN)
labels = parse_case_label_specification (NULL_TREE);
else
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <stdio.h>
#include "config.h"
+#include "system.h"
#include "tree.h"
#include "flags.h"
#include "ch-tree.h"
#include "lex.h"
+#include "toplev.h"
#define SATISFY(ARG) ((ARG) = satisfy(ARG, chain))
-extern void error PROTO((char *, ...));
-extern void error_with_decl PROTO((tree, char *, ...));
-extern void expand_decl PROTO((tree));
-extern void layout_enum PROTO((tree));
-
struct decl_chain
{
struct decl_chain *prev;
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <stdio.h>
-#include <limits.h>
-#include <string.h>
#include "config.h"
+#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "ch-tree.h"
#include "assert.h"
#include "tasking.h"
#include "lex.h"
-
-/* external functions */
-extern void emit_jump PROTO((rtx));
-extern void error PROTO((char *, ...));
-extern void error_with_decl PVPROTO ((tree, char *, ...));
-extern void push_obstacks PROTO((struct obstack *, struct obstack *));
-extern void warning PROTO((char *, ...));
+#include "toplev.h"
/* from ch-lex.l, from compiler directives */
extern tree process_type;
/* name template for process arguments for debugging type */
static char * struct_debug_name = "__tmp_%s_debug_type";
+#if 0
/* name template for process argument variable */
static char * data_name = "__tmp_%s_arg_variable";
+#endif
/* name template for process wrapper */
static char * wrapper_name = "__tmp_%s_wrapper";
return get_identifier (tmpname);
}
-
+#if 0
static tree
get_struct_variable_name (name)
tree name;
sprintf (tmpname, data_name, idp);
return get_identifier (tmpname);
}
+#endif
static tree
get_process_wrapper_name (name)
void
validate_process_parameters (parms)
- tree parms;
+ tree parms ATTRIBUTE_UNUSED;
{
}
\f
tree process_decl, struct_type_node;
tree result;
tree valtail, typetail;
- tree tuple, actuallist = NULL_TREE;
+ tree tuple = NULL_TREE, actuallist = NULL_TREE;
tree typelist;
int parmno = 2;
tree args;
tree buffer_descr;
tree buffer_descr_init;
tree buffer_length;
- tree buffer_ptr;
tree field;
char fldname[20];
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include <stdio.h>
-#include <limits.h>
-#include <string.h>
#include "config.h"
+#include "system.h"
#include "tree.h"
#include "rtl.h"
#include "ch-tree.h"
#include "input.h"
#include "obstack.h"
#include "lex.h"
+#include "toplev.h"
#ifndef LONG_TYPE_SIZE
#define LONG_TYPE_SIZE BITS_PER_WORD
void
build_after_timeout_start ()
{
- tree label_name, goto_where;
+ tree label_name;
if (! ignoring)
{
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h"
+#include "system.h"
#include "obstack.h"
#include "tree.h"
#include "ch-tree.h"
+#include "toplev.h"
/* Here is how primitive or already-canonicalized types'
hash codes are made. */
#define TYPE_HASH(TYPE) ((HOST_WIDE_INT) (TYPE) & 0777777)
-extern void error PROTO((char *, ...));
-extern int get_type_precision PROTO((tree, tree));
-
extern struct obstack permanent_obstack;
/* This is special sentinel used to communicate from build_string_type
to layout_chill_range_type for the index range of a string. */
like a strange sort of assignment). */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "tree.h"
#include "ch-tree.h"
#include "flags.h"
#include "rtl.h"
#include "expr.h"
#include "lex.h"
-
-extern tree build_chill_compound_expr PROTO((tree));
-extern tree build_component_ref PROTO((tree, tree));
-extern void c_expand_return PROTO((tree));
-extern int ch_singleton_set PROTO((tree));
-extern void error PROTO((char *, ...));
-extern void error_with_decl PROTO((tree, char *, ...));
-extern int mark_addressable PROTO((tree));
-extern void pedwarn PROTO((char *, ...));
-extern void pedwarn_with_decl PROTO((tree, char *, ...));
-extern tree require_complete_type PROTO((tree));
-extern void sorry PROTO((char *, ...));
-extern void warning PROTO((char *, ...));
-extern int get_type_precision PROTO((tree, tree));
+#include "toplev.h"
extern tree intQI_type_node;
extern tree intHI_type_node;
extern tree unsigned_intTI_type_node;
/* forward declarations */
-tree chill_expand_tuple PROTO((tree, tree));
static int chill_l_equivalent PROTO((tree, tree, struct mode_chain*));
-extern tree extract_constant_from_buffer();
+static tree extract_constant_from_buffer PROTO((tree, unsigned char *, int));
+static int expand_constant_to_buffer PROTO((tree, unsigned char *, int));
\f
/*
* This function checks an array access.
tree element_type = TREE_TYPE (array_type);
tree slice_type = build_simple_array_type (element_type, index_type, NULL_TREE);
tree slice_pointer_type;
- int is_static;
tree max_size;
if (CH_CHARS_TYPE_P (array_type))
Returns 1 on success, or 0 on failure. (Either the VALUE was
not constant, or we don't know how to do the conversion.) */
-int
+static int
expand_constant_to_buffer (value, buffer, buf_size)
tree value;
unsigned char *buffer;
{
tree min_val = TYPE_MIN_VALUE (TYPE_DOMAIN (type));
if (min_val)
- if (TREE_CODE (min_val) != INTEGER_CST)
- return 0;
- else
- min_index = TREE_INT_CST_LOW (min_val);
+ {
+ if (TREE_CODE (min_val) != INTEGER_CST)
+ return 0;
+ else
+ min_index = TREE_INT_CST_LOW (min_val);
+ }
}
next_index = min_index;
Returns NULL_TREE on failure. (E.g. the TYPE might be variable size,
or perhaps we don't know how to do the conversion.) */
-tree
+static tree
extract_constant_from_buffer (type, buffer, buf_size)
tree type;
unsigned char *buffer;
return 0;
value = TYPE_MIN_VALUE (TYPE_DOMAIN (type));
if (value)
- if (TREE_CODE (value) != INTEGER_CST)
- return 0;
- else
- min_index = TREE_INT_CST_LOW (value);
+ {
+ if (TREE_CODE (value) != INTEGER_CST)
+ return 0;
+ else
+ min_index = TREE_INT_CST_LOW (value);
+ }
value = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
if (value == NULL_TREE || TREE_CODE (value) != INTEGER_CST)
return 0;
mode = TREE_TYPE (mode);
if (TREE_TYPE (expr) == NULL_TREE)
- if (TREE_CODE (expr) == CONSTRUCTOR)
- return TREE_CODE (mode) == RECORD_TYPE
- || ((TREE_CODE (mode) == SET_TYPE || TREE_CODE (mode) == ARRAY_TYPE)
- && ! TYPE_STRING_FLAG (mode));
- else
- return TREE_CODE (expr) == CASE_EXPR || TREE_CODE (expr) == COND_EXPR;
+ {
+ if (TREE_CODE (expr) == CONSTRUCTOR)
+ return TREE_CODE (mode) == RECORD_TYPE
+ || ((TREE_CODE (mode) == SET_TYPE || TREE_CODE (mode) == ARRAY_TYPE)
+ && ! TYPE_STRING_FLAG (mode));
+ else
+ return TREE_CODE (expr) == CASE_EXPR || TREE_CODE (expr) == COND_EXPR;
+ }
class = chill_expr_class (expr);
switch (class.kind)
tree array_type;
{
tree layout, temp, what, element_type;
- int stepsize, word, start_bit, offset, length, natural_length;
+ int stepsize, word, start_bit, length, natural_length;
int stepsize_specified;
int start_bit_error = 0;
int length_error = 0;
int save_readonly = TYPE_READONLY (type);
tree save_novelty = CH_NOVELTY (type);
tree save_domain = TYPE_DOMAIN (type);
- struct lang_type *save_lang_specific = TYPE_LANG_SPECIFIC (type);
if (origin == NULL_TREE)
abort ();
return null_pointer_node;
return 0;
}
+ default:
+ return 0;
}
-
- return 0;
}
\f
/* Return an integer type with BITS bits of precision,