1998-08-27 22:51:39 +02:00
|
|
|
|
/* Exception support for GNU CHILL.
|
|
|
|
|
WARNING: Only works for native (needs setjmp.h)! FIXME!
|
diagnostic.h (set_internal_error_function): Renamed.
* diagnostic.h (set_internal_error_function): Renamed.
* toplev.h (internal_error): Renamed from fatal.
(pfatal_with_name): Deleted.
(fatal_io_error): Now has printf-style arguments.
* diagnostic.c (pfatal_with_name): Deleted.
(fatal_io_error): Rework to have args in printf-style.
(set_internal_error_function): Renamed from set_fatal_function.
(internal_error): Renamed from fatal.
(error_recursion, fancy_abort): Call internal_error instead of fatal.
* dwarf2out.c (get_cfa_from_loc_descr): Likewise.
* emit-rtl.c (gen_realpart, gen_imagpart): Likewise.
* expr.c (check_max_integer_computation_mode, expand_expr): Likewise.
* flow.c (verify_flow_info): Likewise.
* config/arm/arm.c (thumb_unexpanded_epilogue): Likewise.
* config/mips/mips.c (save_restore_insns): Likewise.
* cp/init.c (build_java_class_ref): Likewise.
(dsp16xx_reg_class_from_letter): Likewise.
(limit_reload_class, double_reg_to_memory): Likewise.
(print_operand_address, emit_1600_code_shift): Likewise.
(gen_tst_reg, gen_compare_reg): Likewise.
* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
* cp/decl.c (pushdecl): Likewise.
* java/check-init.c (check_init): Likewise.
* java/expr.c (java_lang_expand_expr): Likewise.
* java/jcf-parse.c (get_constant): Likewise.
* java/mangle.c (java_mangle_decl): Likewise.
* java/parse.y (make_nested_class_name, java_complete_lhs): Likewise.
(operator_string): Likewise.
* except.c (duplicate_eh_handlers): Call abort instead of fatal.
* flow.c (verify_flow_info): Likewise.
* ch/convert.c (convert): Likewise.
* ch/except.c (pop_handler, chill_check_no_handlers): Likewise.
* ch/expr.c (chill_expand_expr): Likewise.
* ch/parse.c (peek_token_, pushback_token, require): Likewise.
* config/arm/arm.c (thumb_load_double_from_address): Likewise.
* config/avr/avr.c (pttreg_to_str, unique_section): Likewise.
(avr_normalize_condition): Likewise.
* config/c4x/c4x.c (c4x_emit_libcall, c4x_valid_operands): Likewise.
* config/dsp16xx/dsp16xx.c (dsp16xx_reg_class_from_letter): Likewise.
(limit_reload_class, double_reg_to_memory): Likewise.
(print_operand_address, emit_1600_code_shift): Likewise.
(gen_tst_reg, gen_compare_reg): Likewise.
* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
* cp/decl.c (pushdecl): Likewise.
* java/check-init.c (check_init): Likewise.
* java/class.c (build_class_ref): Likewise.
* java/constants.c (write_constant_pool): Likewise.
* java/decl.c (start_java_method): Likewise.
* java/expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
(java_stack_dup, encode_newarray_type): Likewise.
(build_java_array_length_access): Likewise.
(build_java_check_indexed_type, expand_java_pushc): Likewise.
(build_java_soft_divmod, build_invokeinterface): Likewise.
* java/java-tree.h (INNER_CLASS_P): Likewise.
* java/jcf-parse.c (parse_signature, get_name_constant): Likewise.
(give_name_to_class, get_class_constant): Likewise.
* java/jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
(find_constant_index, generate_bytecode_conditional): Likewise.
(generate_bytecode_insns, perform_relocations): Likewise.
* java/lex.c (java_unget_unicode, java_lex): Likewise.
* java/mangle.c (mangle_type, mangle_record_type): Likewise.
(mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
(finish_mangling): Likewise.
* java/parse.h (MARK_FINAL_PARMS): Likewise.
* java/parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
(obtain_incomplete_type, java_complete_class): Likewise.
(java_check_regular_methods, java_complete_expand_method): Likewise.
(cut_identifier_in_qualified, check_deprecation): Likewise.
(patch_invoke, find_applicable_accessible_methods_list): Likewise.
(java_complete_lhs, lookup_name_in_blocks): Likewise.
(check_final_variable_indirect_assignment, build_unaryop): Likewise.
* java/typeck.c (set_local_type, parse_signature_type): Likewise.
(parse_signature_string, build_java_signature): Likewise;
(set_java_signature): Likewise.
* java/verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.
* c-parse.in (methoddef): Call fatal_error instead of fatal.
* objc/objc-act.c (build_ivar_chain): Likewise.
* cp/except.c (decl_is_java_type): Likewise.
* cp/init.c (build_java_class_ref): Likewise.
* cp/init.c (build_new_1): Likewise.
* f/com.c (ffecom_init_0): Likewise.
* java/class.c (add_method, build_static_field_ref): Likewise.
* java/expr.c (build_known_method_ref, expand_invoke): Likewise.
* java/jcf-parse.c (get_constant, jcf_parse): Likewise.
* java/lex.c (java_new_new_lexer): Likewise.
* java/jv-scan.c (main): Likewise.
(fatal_error): Renamed from fatal.
* dwarfout.c (dwarfout_init): Call fatal_io_error instead of
pfatal_with_name.
* graph.c (clean_graph_dump_file): Likewise.
* profile.c (init_branch_prob): Likewise.
* ch/grant.c (write_grant_file): Likewise.
* ch/lex.c (init_parse, same_file, yywrap): Likewise.
* f/com.c (init_parse): Likewise.
* java/jcf-parse.c (yyparse): Likewise.
* objc/objc-act.c (objc_init): Likewise.
* java/jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
(yyparse): Likewise.
* java/jcf-write.c (make_class_file_name, write_classfile): Likewise.
* java/lex.c (java_get_line_col): Likewise.
* hash.c (hash_allocate): Don't check for failure returns from
obstack functions that can't fail.
(hash_table_init_n, hash_table_init): Likewise; also now return void.
* hash.h (hash_table_init_n, hash_table_init): Now return void.
* cp/decl.c (build_typename_type): hash_table_init now returns void.
* ch/lang.c (GNU_xref_begin, GNU_xref_end): Deleted.
* ch/lex.c (convert_bitstring): Delete check for alloca failure.
* config/dsp16xx/dsp16xx.c (dsp16xx_invalid_register_for_compare):
Deleted.
* config/dsp16xx/dsp16xx.md (unnamed cmphi): Call abort instead of it.
* f/com.c (ffecom_decode_include_option_): Make errors non-fatal.
* f/lex.c (ffelex_cfelex_, ffelex_get_directive_line_): Likewise.
(ffelex_hash_): Likewise.
* config/arm/arm.c (arm_override_options): Likewise.
* config/avr/avr.c (avr_override_options): Likewise.
* config/c4x/c4x.c (c4x_expand_prologue): Likewise.
* config/dsp16xx/dsp16xx.c (function_prologue): Likewise.
* config/h8300/h8300.c (h8300_init_once): Likewise.
* config/mips/mips.c (override_options): Likewise.
* config/i386/i386.c (override_options): Likewise, rework.
* config/m68k/m68k.c (override_options): Likewise.
* cp/decl.c (init_decl_processing): Likewise.
* java/jcf-parse.c (load_class): Likewise.
* config/dsp16xx/dsp16xx.c (print_operand): Call output_operand_lossage
instead of fatal.
* config/mips/mips.c (print_operand): Likewise.
* java/lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
* objc/objc_act.c (objc_check_decl): Remove unneeded fatal call.
(get_object_reference): Likewise.
From-SVN: r39444
2001-02-05 00:18:43 +01:00
|
|
|
|
Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001
|
2000-12-07 02:55:52 +01:00
|
|
|
|
Free Software Foundation, Inc.
|
1998-08-27 22:51:39 +02:00
|
|
|
|
|
|
|
|
|
This file is part of GNU CC.
|
|
|
|
|
|
|
|
|
|
GNU CC is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
|
|
GNU CC is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with GNU CC; see the file COPYING. If not, write to
|
1999-01-11 14:17:38 +01:00
|
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1998-08-27 22:51:39 +02:00
|
|
|
|
|
|
|
|
|
#include "config.h"
|
1998-09-20 11:06:51 +02:00
|
|
|
|
#include "system.h"
|
1998-08-27 22:51:39 +02:00
|
|
|
|
|
|
|
|
|
/* On Suns this can get you to the right definition if you
|
|
|
|
|
set the right value for TARGET. */
|
|
|
|
|
#include <setjmp.h>
|
|
|
|
|
#ifdef sequent
|
|
|
|
|
/* Can you believe they forgot this? */
|
|
|
|
|
#ifndef _JBLEN
|
|
|
|
|
#define _JBLEN 11
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef _JBLEN
|
|
|
|
|
#define _JBLEN (sizeof(jmp_buf)/sizeof(int))
|
|
|
|
|
#define _JBLEN_2 _JBLEN+20
|
|
|
|
|
#else
|
|
|
|
|
/* if we use i.e. posix threads, this buffer must be longer */
|
|
|
|
|
#define _JBLEN_2 _JBLEN+20
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* On Linux setjmp is __setjmp FIXME: what is for CROSS */
|
|
|
|
|
#ifndef SETJMP_LIBRARY_NAME
|
|
|
|
|
#ifdef __linux__
|
|
|
|
|
#define SETJMP_LIBRARY_NAME "__setjmp"
|
|
|
|
|
#else
|
|
|
|
|
#define SETJMP_LIBRARY_NAME "setjmp"
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
1998-09-30 18:49:55 +02:00
|
|
|
|
#include "tree.h"
|
|
|
|
|
#include "ch-tree.h"
|
|
|
|
|
#include "rtl.h"
|
|
|
|
|
#include "toplev.h"
|
|
|
|
|
|
1998-08-27 22:51:39 +02:00
|
|
|
|
extern int expand_exit_needed;
|
|
|
|
|
|
|
|
|
|
static tree link_handler_decl;
|
|
|
|
|
static tree handler_link_pointer_type;
|
|
|
|
|
static tree unlink_handler_decl;
|
|
|
|
|
static int exceptions_initialized = 0;
|
2000-01-17 15:51:05 +01:00
|
|
|
|
static void emit_setup_handler PARAMS ((void));
|
|
|
|
|
static void initialize_exceptions PARAMS ((void));
|
|
|
|
|
static tree start_handler_array PARAMS ((void));
|
|
|
|
|
static void finish_handler_array PARAMS ((void));
|
1998-08-27 22:51:39 +02:00
|
|
|
|
static tree char_pointer_type_for_handler;
|
|
|
|
|
|
|
|
|
|
/* If this is 1, operations to push and pop on the __exceptionStack
|
|
|
|
|
are inline. The default is is to use a function call, to
|
|
|
|
|
allow for a per-thread exception stack. */
|
|
|
|
|
static int inline_exception_stack_ops = 0;
|
|
|
|
|
|
|
|
|
|
struct handler_state
|
|
|
|
|
{
|
|
|
|
|
struct handler_state *next;
|
|
|
|
|
|
|
|
|
|
/* Starts at 0, then incremented for every <on-alternative>. */
|
|
|
|
|
int prev_on_alternative;
|
|
|
|
|
|
|
|
|
|
/* If > 0: handler number for ELSE handler. */
|
|
|
|
|
int else_handler;
|
|
|
|
|
|
|
|
|
|
int action_number;
|
|
|
|
|
|
|
|
|
|
char do_pushlevel;
|
|
|
|
|
|
|
|
|
|
tree on_alt_list;
|
|
|
|
|
tree setjmp_expr;
|
|
|
|
|
|
|
|
|
|
/* A decl for the static handler array (used to map exception name to int).*/
|
|
|
|
|
tree handler_array_decl;
|
|
|
|
|
|
|
|
|
|
rtx end_label;
|
|
|
|
|
|
|
|
|
|
/* Used to pass a tree from emit_setup_handler to chill_start_on. */
|
|
|
|
|
tree handler_ref;
|
|
|
|
|
|
|
|
|
|
tree unlink_cleanup;
|
|
|
|
|
|
|
|
|
|
tree function;
|
|
|
|
|
|
|
|
|
|
/* flag to indicate that we are currently compiling this handler.
|
|
|
|
|
is_handled will need this to determine an unhandled exception */
|
|
|
|
|
int compiling;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* This is incremented by one each time we start an action which
|
|
|
|
|
might have an ON-handler. It is reset between passes. */
|
|
|
|
|
static int action_number = 0;
|
|
|
|
|
|
|
|
|
|
int action_nesting_level = 0;
|
|
|
|
|
|
|
|
|
|
/* The global_handler_list is constructed in pass 1. It is not sorted.
|
|
|
|
|
It contains one element for each action that actually had an ON-handler.
|
|
|
|
|
An element's ACTION_NUMBER matches the action_number
|
|
|
|
|
of that action. The global_handler_list is eaten up during pass 2. */
|
|
|
|
|
#define ACTION_NUMBER(HANDLER) ((HANDLER)->action_number)
|
|
|
|
|
struct handler_state *global_handler_list = NULL;
|
|
|
|
|
|
|
|
|
|
/* This is a stack of handlers, one for each nested ON-handler. */
|
|
|
|
|
static struct handler_state *current_handler = NULL;
|
|
|
|
|
|
|
|
|
|
static struct handler_state *free_handlers = NULL; /* freelist */
|
|
|
|
|
|
|
|
|
|
static tree handler_element_type;
|
|
|
|
|
static tree handler_link_type;
|
|
|
|
|
static tree BISJ;
|
|
|
|
|
static tree jbuf_ident, prev_ident, handlers_ident;
|
|
|
|
|
static tree exception_stack_decl = 0;
|
|
|
|
|
|
2001-10-31 01:59:40 +01:00
|
|
|
|
/* Chain of cleanups associated with exception handlers.
|
1998-08-27 22:51:39 +02:00
|
|
|
|
The TREE_PURPOSE is an INTEGER_CST whose value is the
|
|
|
|
|
DECL_ACTION_NESTING_LEVEL (when the handled actions was entered).
|
|
|
|
|
The TREE_VALUE is an expression to expand when we exit that action. */
|
|
|
|
|
|
|
|
|
|
static tree cleanup_chain = NULL_TREE;
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
/* Merge the current sequence onto the tail of the previous one. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
pop_sequence ()
|
|
|
|
|
{
|
|
|
|
|
rtx sequence_first = get_insns ();
|
|
|
|
|
|
|
|
|
|
end_sequence ();
|
|
|
|
|
emit_insns (sequence_first);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Things we need to do at the beginning of pass 2. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
except_init_pass_2 ()
|
|
|
|
|
{
|
|
|
|
|
/* First sort the global_handler_list on ACTION_NUMBER.
|
|
|
|
|
This will already be in close to reverse order (the exception being
|
|
|
|
|
nested ON-handlers), so insertion sort should essentially linear. */
|
|
|
|
|
|
|
|
|
|
register struct handler_state *old_list = global_handler_list;
|
|
|
|
|
|
|
|
|
|
/* First add a dummy final element. */
|
|
|
|
|
if (free_handlers)
|
|
|
|
|
global_handler_list = free_handlers;
|
|
|
|
|
else
|
|
|
|
|
global_handler_list
|
|
|
|
|
= (struct handler_state*) permalloc (sizeof (struct handler_state));
|
|
|
|
|
/* Make the final dummy "larger" than any other element. */
|
|
|
|
|
ACTION_NUMBER (global_handler_list) = action_number + 1;
|
|
|
|
|
/* Now move all the elements in old_list over to global_handler_list. */
|
|
|
|
|
while (old_list != NULL)
|
|
|
|
|
{
|
|
|
|
|
register struct handler_state **ptr = &global_handler_list;
|
|
|
|
|
/* Unlink from old_list. */
|
|
|
|
|
register struct handler_state *current = old_list;
|
|
|
|
|
old_list = old_list->next;
|
|
|
|
|
|
|
|
|
|
while (ACTION_NUMBER (current) > ACTION_NUMBER (*ptr))
|
|
|
|
|
ptr = &(*ptr)->next;
|
|
|
|
|
/* Link into proper place in global_handler_list (new list). */
|
|
|
|
|
current->next = *ptr;
|
|
|
|
|
*ptr = current;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Don't forget to reset action_number. */
|
|
|
|
|
action_number = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* This function is called at the beginning of an action that might be
|
|
|
|
|
followed by an ON-handler. Chill syntax doesn't let us know if
|
|
|
|
|
we actually have an ON-handler until we see the ON, so we save
|
|
|
|
|
away during pass 1 that information for use during pass 2. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
push_handler ()
|
|
|
|
|
{
|
|
|
|
|
register struct handler_state *hstate;
|
|
|
|
|
|
|
|
|
|
action_number++;
|
|
|
|
|
action_nesting_level++;
|
|
|
|
|
|
|
|
|
|
if (pass == 1)
|
|
|
|
|
{
|
|
|
|
|
if (free_handlers)
|
|
|
|
|
{
|
|
|
|
|
hstate = free_handlers;
|
|
|
|
|
free_handlers = hstate->next;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
hstate =
|
|
|
|
|
(struct handler_state*) permalloc (sizeof (struct handler_state));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hstate->next = current_handler;
|
|
|
|
|
current_handler = hstate;
|
|
|
|
|
hstate->prev_on_alternative = 0;
|
|
|
|
|
hstate->else_handler = 0;
|
|
|
|
|
hstate->on_alt_list = NULL_TREE;
|
|
|
|
|
hstate->compiling = 0;
|
|
|
|
|
|
|
|
|
|
ACTION_NUMBER (hstate) = action_number;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ACTION_NUMBER (global_handler_list) != action_number)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* OK. This action actually has an ON-handler.
|
|
|
|
|
Pop it from global_handler_list, and use it. */
|
|
|
|
|
|
|
|
|
|
hstate = global_handler_list;
|
|
|
|
|
global_handler_list = hstate->next;
|
|
|
|
|
|
|
|
|
|
/* Since this is pass 2, let's generate prologue code for that. */
|
|
|
|
|
|
|
|
|
|
hstate->next = current_handler;
|
|
|
|
|
current_handler = hstate;
|
|
|
|
|
|
|
|
|
|
hstate->prev_on_alternative = 0;
|
|
|
|
|
hstate->function = current_function_decl;
|
|
|
|
|
|
|
|
|
|
emit_setup_handler ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static tree
|
|
|
|
|
start_handler_array ()
|
|
|
|
|
{
|
|
|
|
|
tree handler_array_type, decl;
|
|
|
|
|
|
|
|
|
|
push_obstacks_nochange ();
|
|
|
|
|
end_temporary_allocation ();
|
|
|
|
|
handler_array_type = build_array_type (handler_element_type, NULL_TREE);
|
|
|
|
|
decl = build_lang_decl (VAR_DECL,
|
|
|
|
|
get_unique_identifier ("handler_table"),
|
|
|
|
|
handler_array_type);
|
|
|
|
|
|
|
|
|
|
/* TREE_TYPE (decl) = handler_array_type;*/
|
|
|
|
|
TREE_READONLY (decl) = 1;
|
|
|
|
|
TREE_STATIC (decl) = 1;
|
|
|
|
|
DECL_INITIAL (decl) = error_mark_node;
|
|
|
|
|
|
|
|
|
|
pushdecl (decl);
|
|
|
|
|
make_decl_rtl (decl, NULL_PTR, 0);
|
|
|
|
|
current_handler->handler_array_decl = decl;
|
|
|
|
|
return decl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
finish_handler_array ()
|
|
|
|
|
{
|
|
|
|
|
tree decl = current_handler->handler_array_decl;
|
|
|
|
|
tree t;
|
|
|
|
|
tree handler_array_init = NULL_TREE;
|
|
|
|
|
int handlers_count = 1;
|
|
|
|
|
int nelts;
|
|
|
|
|
|
|
|
|
|
/* Build the table mapping exceptions to handler(-number)s.
|
|
|
|
|
This is done in reverse order. */
|
|
|
|
|
|
|
|
|
|
/* First push the end of the list. This is either the ELSE
|
|
|
|
|
handler (current_handler->else_handler>0) or NULL handler to indicate
|
|
|
|
|
the end of the list (if current_handler->else-handler == 0).
|
|
|
|
|
The following works either way. */
|
|
|
|
|
handler_array_init = build_tree_list
|
|
|
|
|
(NULL_TREE, chill_expand_tuple
|
|
|
|
|
(handler_element_type,
|
|
|
|
|
build_nt (CONSTRUCTOR, NULL_TREE,
|
|
|
|
|
tree_cons (NULL_TREE,
|
|
|
|
|
null_pointer_node,
|
|
|
|
|
build_tree_list (NULL_TREE,
|
|
|
|
|
build_int_2 (current_handler->else_handler,
|
|
|
|
|
0))))));
|
|
|
|
|
|
|
|
|
|
for (t = current_handler->on_alt_list; t != NULL_TREE; t = TREE_CHAIN (t))
|
|
|
|
|
{ tree handler_number = TREE_PURPOSE(t);
|
|
|
|
|
tree elist = TREE_VALUE (t);
|
|
|
|
|
for ( ; elist != NULL_TREE; elist = TREE_CHAIN (elist))
|
|
|
|
|
{
|
|
|
|
|
tree ex_decl =
|
|
|
|
|
build_chill_exception_decl (IDENTIFIER_POINTER(TREE_VALUE(elist)));
|
|
|
|
|
tree ex_addr = build1 (ADDR_EXPR,
|
|
|
|
|
char_pointer_type_for_handler,
|
|
|
|
|
ex_decl);
|
|
|
|
|
tree el = build_nt (CONSTRUCTOR, NULL_TREE,
|
|
|
|
|
tree_cons (NULL_TREE,
|
|
|
|
|
ex_addr,
|
|
|
|
|
build_tree_list (NULL_TREE,
|
|
|
|
|
handler_number)));
|
|
|
|
|
mark_addressable (ex_decl);
|
|
|
|
|
TREE_CONSTANT (ex_addr) = 1;
|
|
|
|
|
handler_array_init =
|
|
|
|
|
tree_cons (NULL_TREE,
|
|
|
|
|
chill_expand_tuple (handler_element_type, el),
|
|
|
|
|
handler_array_init);
|
|
|
|
|
handlers_count++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if 1
|
|
|
|
|
nelts = list_length (handler_array_init);
|
|
|
|
|
TYPE_DOMAIN (TREE_TYPE (decl))
|
|
|
|
|
= build_index_type (build_int_2 (nelts - 1, - (nelts == 0)));
|
|
|
|
|
layout_type (TREE_TYPE (decl));
|
|
|
|
|
DECL_INITIAL (decl)
|
|
|
|
|
= convert (TREE_TYPE (decl),
|
|
|
|
|
build_nt (CONSTRUCTOR, NULL_TREE, handler_array_init));
|
|
|
|
|
|
|
|
|
|
/* Pop back to the obstack that is current for this binding level.
|
|
|
|
|
This is because MAXINDEX, rtl, etc. to be made below
|
|
|
|
|
must go in the permanent obstack. But don't discard the
|
|
|
|
|
temporary data yet. */
|
|
|
|
|
pop_obstacks ();
|
|
|
|
|
layout_decl (decl, 0);
|
|
|
|
|
/* To prevent make_decl_rtl (called indiectly by rest_of_decl_compilation)
|
|
|
|
|
throwing the existing RTL (which has already been used). */
|
|
|
|
|
PUT_MODE (DECL_RTL (decl), DECL_MODE (decl));
|
|
|
|
|
rest_of_decl_compilation (decl, (char*)0, 0, 0);
|
|
|
|
|
expand_decl_init (decl);
|
|
|
|
|
#else
|
|
|
|
|
/* To prevent make_decl_rtl (called indirectly by finish_decl)
|
|
|
|
|
altering the existing RTL. */
|
|
|
|
|
GET_MODE (DECL_RTL (current_handler->handler_array_decl)) =
|
|
|
|
|
DECL_MODE (current_handler->handler_array_decl);
|
|
|
|
|
|
|
|
|
|
finish_decl (current_handler->handler_array_decl,
|
|
|
|
|
build_nt (CONSTRUCTOR, NULL_TREE, handler_array_init),
|
|
|
|
|
NULL_TREE);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
pop_handler (used)
|
|
|
|
|
int used;
|
|
|
|
|
{
|
|
|
|
|
action_nesting_level--;
|
|
|
|
|
if (pass == 1)
|
|
|
|
|
{
|
|
|
|
|
struct handler_state *old = current_handler;
|
diagnostic.h (set_internal_error_function): Renamed.
* diagnostic.h (set_internal_error_function): Renamed.
* toplev.h (internal_error): Renamed from fatal.
(pfatal_with_name): Deleted.
(fatal_io_error): Now has printf-style arguments.
* diagnostic.c (pfatal_with_name): Deleted.
(fatal_io_error): Rework to have args in printf-style.
(set_internal_error_function): Renamed from set_fatal_function.
(internal_error): Renamed from fatal.
(error_recursion, fancy_abort): Call internal_error instead of fatal.
* dwarf2out.c (get_cfa_from_loc_descr): Likewise.
* emit-rtl.c (gen_realpart, gen_imagpart): Likewise.
* expr.c (check_max_integer_computation_mode, expand_expr): Likewise.
* flow.c (verify_flow_info): Likewise.
* config/arm/arm.c (thumb_unexpanded_epilogue): Likewise.
* config/mips/mips.c (save_restore_insns): Likewise.
* cp/init.c (build_java_class_ref): Likewise.
(dsp16xx_reg_class_from_letter): Likewise.
(limit_reload_class, double_reg_to_memory): Likewise.
(print_operand_address, emit_1600_code_shift): Likewise.
(gen_tst_reg, gen_compare_reg): Likewise.
* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
* cp/decl.c (pushdecl): Likewise.
* java/check-init.c (check_init): Likewise.
* java/expr.c (java_lang_expand_expr): Likewise.
* java/jcf-parse.c (get_constant): Likewise.
* java/mangle.c (java_mangle_decl): Likewise.
* java/parse.y (make_nested_class_name, java_complete_lhs): Likewise.
(operator_string): Likewise.
* except.c (duplicate_eh_handlers): Call abort instead of fatal.
* flow.c (verify_flow_info): Likewise.
* ch/convert.c (convert): Likewise.
* ch/except.c (pop_handler, chill_check_no_handlers): Likewise.
* ch/expr.c (chill_expand_expr): Likewise.
* ch/parse.c (peek_token_, pushback_token, require): Likewise.
* config/arm/arm.c (thumb_load_double_from_address): Likewise.
* config/avr/avr.c (pttreg_to_str, unique_section): Likewise.
(avr_normalize_condition): Likewise.
* config/c4x/c4x.c (c4x_emit_libcall, c4x_valid_operands): Likewise.
* config/dsp16xx/dsp16xx.c (dsp16xx_reg_class_from_letter): Likewise.
(limit_reload_class, double_reg_to_memory): Likewise.
(print_operand_address, emit_1600_code_shift): Likewise.
(gen_tst_reg, gen_compare_reg): Likewise.
* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
* cp/decl.c (pushdecl): Likewise.
* java/check-init.c (check_init): Likewise.
* java/class.c (build_class_ref): Likewise.
* java/constants.c (write_constant_pool): Likewise.
* java/decl.c (start_java_method): Likewise.
* java/expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
(java_stack_dup, encode_newarray_type): Likewise.
(build_java_array_length_access): Likewise.
(build_java_check_indexed_type, expand_java_pushc): Likewise.
(build_java_soft_divmod, build_invokeinterface): Likewise.
* java/java-tree.h (INNER_CLASS_P): Likewise.
* java/jcf-parse.c (parse_signature, get_name_constant): Likewise.
(give_name_to_class, get_class_constant): Likewise.
* java/jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
(find_constant_index, generate_bytecode_conditional): Likewise.
(generate_bytecode_insns, perform_relocations): Likewise.
* java/lex.c (java_unget_unicode, java_lex): Likewise.
* java/mangle.c (mangle_type, mangle_record_type): Likewise.
(mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
(finish_mangling): Likewise.
* java/parse.h (MARK_FINAL_PARMS): Likewise.
* java/parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
(obtain_incomplete_type, java_complete_class): Likewise.
(java_check_regular_methods, java_complete_expand_method): Likewise.
(cut_identifier_in_qualified, check_deprecation): Likewise.
(patch_invoke, find_applicable_accessible_methods_list): Likewise.
(java_complete_lhs, lookup_name_in_blocks): Likewise.
(check_final_variable_indirect_assignment, build_unaryop): Likewise.
* java/typeck.c (set_local_type, parse_signature_type): Likewise.
(parse_signature_string, build_java_signature): Likewise;
(set_java_signature): Likewise.
* java/verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.
* c-parse.in (methoddef): Call fatal_error instead of fatal.
* objc/objc-act.c (build_ivar_chain): Likewise.
* cp/except.c (decl_is_java_type): Likewise.
* cp/init.c (build_java_class_ref): Likewise.
* cp/init.c (build_new_1): Likewise.
* f/com.c (ffecom_init_0): Likewise.
* java/class.c (add_method, build_static_field_ref): Likewise.
* java/expr.c (build_known_method_ref, expand_invoke): Likewise.
* java/jcf-parse.c (get_constant, jcf_parse): Likewise.
* java/lex.c (java_new_new_lexer): Likewise.
* java/jv-scan.c (main): Likewise.
(fatal_error): Renamed from fatal.
* dwarfout.c (dwarfout_init): Call fatal_io_error instead of
pfatal_with_name.
* graph.c (clean_graph_dump_file): Likewise.
* profile.c (init_branch_prob): Likewise.
* ch/grant.c (write_grant_file): Likewise.
* ch/lex.c (init_parse, same_file, yywrap): Likewise.
* f/com.c (init_parse): Likewise.
* java/jcf-parse.c (yyparse): Likewise.
* objc/objc-act.c (objc_init): Likewise.
* java/jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
(yyparse): Likewise.
* java/jcf-write.c (make_class_file_name, write_classfile): Likewise.
* java/lex.c (java_get_line_col): Likewise.
* hash.c (hash_allocate): Don't check for failure returns from
obstack functions that can't fail.
(hash_table_init_n, hash_table_init): Likewise; also now return void.
* hash.h (hash_table_init_n, hash_table_init): Now return void.
* cp/decl.c (build_typename_type): hash_table_init now returns void.
* ch/lang.c (GNU_xref_begin, GNU_xref_end): Deleted.
* ch/lex.c (convert_bitstring): Delete check for alloca failure.
* config/dsp16xx/dsp16xx.c (dsp16xx_invalid_register_for_compare):
Deleted.
* config/dsp16xx/dsp16xx.md (unnamed cmphi): Call abort instead of it.
* f/com.c (ffecom_decode_include_option_): Make errors non-fatal.
* f/lex.c (ffelex_cfelex_, ffelex_get_directive_line_): Likewise.
(ffelex_hash_): Likewise.
* config/arm/arm.c (arm_override_options): Likewise.
* config/avr/avr.c (avr_override_options): Likewise.
* config/c4x/c4x.c (c4x_expand_prologue): Likewise.
* config/dsp16xx/dsp16xx.c (function_prologue): Likewise.
* config/h8300/h8300.c (h8300_init_once): Likewise.
* config/mips/mips.c (override_options): Likewise.
* config/i386/i386.c (override_options): Likewise, rework.
* config/m68k/m68k.c (override_options): Likewise.
* cp/decl.c (init_decl_processing): Likewise.
* java/jcf-parse.c (load_class): Likewise.
* config/dsp16xx/dsp16xx.c (print_operand): Call output_operand_lossage
instead of fatal.
* config/mips/mips.c (print_operand): Likewise.
* java/lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
* objc/objc_act.c (objc_check_decl): Remove unneeded fatal call.
(get_object_reference): Likewise.
From-SVN: r39444
2001-02-05 00:18:43 +01:00
|
|
|
|
|
1998-08-27 22:51:39 +02:00
|
|
|
|
if (old == NULL)
|
diagnostic.h (set_internal_error_function): Renamed.
* diagnostic.h (set_internal_error_function): Renamed.
* toplev.h (internal_error): Renamed from fatal.
(pfatal_with_name): Deleted.
(fatal_io_error): Now has printf-style arguments.
* diagnostic.c (pfatal_with_name): Deleted.
(fatal_io_error): Rework to have args in printf-style.
(set_internal_error_function): Renamed from set_fatal_function.
(internal_error): Renamed from fatal.
(error_recursion, fancy_abort): Call internal_error instead of fatal.
* dwarf2out.c (get_cfa_from_loc_descr): Likewise.
* emit-rtl.c (gen_realpart, gen_imagpart): Likewise.
* expr.c (check_max_integer_computation_mode, expand_expr): Likewise.
* flow.c (verify_flow_info): Likewise.
* config/arm/arm.c (thumb_unexpanded_epilogue): Likewise.
* config/mips/mips.c (save_restore_insns): Likewise.
* cp/init.c (build_java_class_ref): Likewise.
(dsp16xx_reg_class_from_letter): Likewise.
(limit_reload_class, double_reg_to_memory): Likewise.
(print_operand_address, emit_1600_code_shift): Likewise.
(gen_tst_reg, gen_compare_reg): Likewise.
* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
* cp/decl.c (pushdecl): Likewise.
* java/check-init.c (check_init): Likewise.
* java/expr.c (java_lang_expand_expr): Likewise.
* java/jcf-parse.c (get_constant): Likewise.
* java/mangle.c (java_mangle_decl): Likewise.
* java/parse.y (make_nested_class_name, java_complete_lhs): Likewise.
(operator_string): Likewise.
* except.c (duplicate_eh_handlers): Call abort instead of fatal.
* flow.c (verify_flow_info): Likewise.
* ch/convert.c (convert): Likewise.
* ch/except.c (pop_handler, chill_check_no_handlers): Likewise.
* ch/expr.c (chill_expand_expr): Likewise.
* ch/parse.c (peek_token_, pushback_token, require): Likewise.
* config/arm/arm.c (thumb_load_double_from_address): Likewise.
* config/avr/avr.c (pttreg_to_str, unique_section): Likewise.
(avr_normalize_condition): Likewise.
* config/c4x/c4x.c (c4x_emit_libcall, c4x_valid_operands): Likewise.
* config/dsp16xx/dsp16xx.c (dsp16xx_reg_class_from_letter): Likewise.
(limit_reload_class, double_reg_to_memory): Likewise.
(print_operand_address, emit_1600_code_shift): Likewise.
(gen_tst_reg, gen_compare_reg): Likewise.
* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
* cp/decl.c (pushdecl): Likewise.
* java/check-init.c (check_init): Likewise.
* java/class.c (build_class_ref): Likewise.
* java/constants.c (write_constant_pool): Likewise.
* java/decl.c (start_java_method): Likewise.
* java/expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
(java_stack_dup, encode_newarray_type): Likewise.
(build_java_array_length_access): Likewise.
(build_java_check_indexed_type, expand_java_pushc): Likewise.
(build_java_soft_divmod, build_invokeinterface): Likewise.
* java/java-tree.h (INNER_CLASS_P): Likewise.
* java/jcf-parse.c (parse_signature, get_name_constant): Likewise.
(give_name_to_class, get_class_constant): Likewise.
* java/jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
(find_constant_index, generate_bytecode_conditional): Likewise.
(generate_bytecode_insns, perform_relocations): Likewise.
* java/lex.c (java_unget_unicode, java_lex): Likewise.
* java/mangle.c (mangle_type, mangle_record_type): Likewise.
(mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
(finish_mangling): Likewise.
* java/parse.h (MARK_FINAL_PARMS): Likewise.
* java/parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
(obtain_incomplete_type, java_complete_class): Likewise.
(java_check_regular_methods, java_complete_expand_method): Likewise.
(cut_identifier_in_qualified, check_deprecation): Likewise.
(patch_invoke, find_applicable_accessible_methods_list): Likewise.
(java_complete_lhs, lookup_name_in_blocks): Likewise.
(check_final_variable_indirect_assignment, build_unaryop): Likewise.
* java/typeck.c (set_local_type, parse_signature_type): Likewise.
(parse_signature_string, build_java_signature): Likewise;
(set_java_signature): Likewise.
* java/verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.
* c-parse.in (methoddef): Call fatal_error instead of fatal.
* objc/objc-act.c (build_ivar_chain): Likewise.
* cp/except.c (decl_is_java_type): Likewise.
* cp/init.c (build_java_class_ref): Likewise.
* cp/init.c (build_new_1): Likewise.
* f/com.c (ffecom_init_0): Likewise.
* java/class.c (add_method, build_static_field_ref): Likewise.
* java/expr.c (build_known_method_ref, expand_invoke): Likewise.
* java/jcf-parse.c (get_constant, jcf_parse): Likewise.
* java/lex.c (java_new_new_lexer): Likewise.
* java/jv-scan.c (main): Likewise.
(fatal_error): Renamed from fatal.
* dwarfout.c (dwarfout_init): Call fatal_io_error instead of
pfatal_with_name.
* graph.c (clean_graph_dump_file): Likewise.
* profile.c (init_branch_prob): Likewise.
* ch/grant.c (write_grant_file): Likewise.
* ch/lex.c (init_parse, same_file, yywrap): Likewise.
* f/com.c (init_parse): Likewise.
* java/jcf-parse.c (yyparse): Likewise.
* objc/objc-act.c (objc_init): Likewise.
* java/jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
(yyparse): Likewise.
* java/jcf-write.c (make_class_file_name, write_classfile): Likewise.
* java/lex.c (java_get_line_col): Likewise.
* hash.c (hash_allocate): Don't check for failure returns from
obstack functions that can't fail.
(hash_table_init_n, hash_table_init): Likewise; also now return void.
* hash.h (hash_table_init_n, hash_table_init): Now return void.
* cp/decl.c (build_typename_type): hash_table_init now returns void.
* ch/lang.c (GNU_xref_begin, GNU_xref_end): Deleted.
* ch/lex.c (convert_bitstring): Delete check for alloca failure.
* config/dsp16xx/dsp16xx.c (dsp16xx_invalid_register_for_compare):
Deleted.
* config/dsp16xx/dsp16xx.md (unnamed cmphi): Call abort instead of it.
* f/com.c (ffecom_decode_include_option_): Make errors non-fatal.
* f/lex.c (ffelex_cfelex_, ffelex_get_directive_line_): Likewise.
(ffelex_hash_): Likewise.
* config/arm/arm.c (arm_override_options): Likewise.
* config/avr/avr.c (avr_override_options): Likewise.
* config/c4x/c4x.c (c4x_expand_prologue): Likewise.
* config/dsp16xx/dsp16xx.c (function_prologue): Likewise.
* config/h8300/h8300.c (h8300_init_once): Likewise.
* config/mips/mips.c (override_options): Likewise.
* config/i386/i386.c (override_options): Likewise, rework.
* config/m68k/m68k.c (override_options): Likewise.
* cp/decl.c (init_decl_processing): Likewise.
* java/jcf-parse.c (load_class): Likewise.
* config/dsp16xx/dsp16xx.c (print_operand): Call output_operand_lossage
instead of fatal.
* config/mips/mips.c (print_operand): Likewise.
* java/lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
* objc/objc_act.c (objc_check_decl): Remove unneeded fatal call.
(get_object_reference): Likewise.
From-SVN: r39444
2001-02-05 00:18:43 +01:00
|
|
|
|
abort ();
|
1998-08-27 22:51:39 +02:00
|
|
|
|
current_handler = old->next;
|
|
|
|
|
|
|
|
|
|
if (used)
|
|
|
|
|
{ /* Push unto global_handler_list. */
|
|
|
|
|
old->next = global_handler_list;
|
|
|
|
|
global_handler_list = old;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Push onto free_handlers free list. */
|
|
|
|
|
old->next = free_handlers;
|
|
|
|
|
free_handlers = old;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (used)
|
|
|
|
|
{
|
|
|
|
|
current_handler = current_handler->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit code before an action that has an ON-handler. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
emit_setup_handler ()
|
|
|
|
|
{
|
|
|
|
|
tree handler_decl, handler_addr, t;
|
|
|
|
|
|
|
|
|
|
/* Field references. */
|
|
|
|
|
tree jbuf_ref, handlers_ref,prev_ref;
|
|
|
|
|
if (!exceptions_initialized)
|
|
|
|
|
{
|
|
|
|
|
/* We temporarily reset the maximum_field_alignment to zero so the
|
|
|
|
|
compiler's exception data structures can be compatible with the
|
|
|
|
|
run-time system, even when we're compiling with -fpack. */
|
2000-02-11 16:48:24 +01:00
|
|
|
|
unsigned int save_maximum_field_alignment = maximum_field_alignment;
|
1998-08-27 22:51:39 +02:00
|
|
|
|
maximum_field_alignment = 0;
|
|
|
|
|
push_obstacks_nochange ();
|
|
|
|
|
end_temporary_allocation ();
|
|
|
|
|
initialize_exceptions ();
|
|
|
|
|
pop_obstacks ();
|
|
|
|
|
maximum_field_alignment = save_maximum_field_alignment;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
push_momentary ();
|
|
|
|
|
|
|
|
|
|
handler_decl = build_lang_decl (VAR_DECL,
|
|
|
|
|
get_unique_identifier ("handler"),
|
|
|
|
|
handler_link_type);
|
|
|
|
|
push_obstacks_nochange ();
|
|
|
|
|
pushdecl(handler_decl);
|
|
|
|
|
expand_decl (handler_decl);
|
|
|
|
|
finish_decl (handler_decl);
|
|
|
|
|
|
|
|
|
|
jbuf_ref = build_component_ref (handler_decl, jbuf_ident);
|
|
|
|
|
jbuf_ref = build_chill_arrow_expr (jbuf_ref, 1);
|
|
|
|
|
handlers_ref = build_component_ref (handler_decl, handlers_ident);
|
|
|
|
|
prev_ref = build_component_ref (handler_decl, prev_ident);
|
|
|
|
|
|
|
|
|
|
/* Emit code to link in handler in __exceptionStack chain. */
|
|
|
|
|
mark_addressable (handler_decl);
|
|
|
|
|
handler_addr = build1 (ADDR_EXPR, handler_link_pointer_type, handler_decl);
|
|
|
|
|
if (inline_exception_stack_ops)
|
|
|
|
|
{
|
|
|
|
|
expand_expr_stmt (build_chill_modify_expr (prev_ref,
|
|
|
|
|
exception_stack_decl));
|
|
|
|
|
expand_expr_stmt (build_chill_modify_expr (exception_stack_decl,
|
|
|
|
|
handler_addr));
|
|
|
|
|
current_handler->handler_ref = prev_ref;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
expand_expr_stmt (build_chill_function_call (link_handler_decl,
|
|
|
|
|
build_tree_list (NULL_TREE,
|
|
|
|
|
handler_addr)));
|
|
|
|
|
current_handler->handler_ref = handler_addr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Expand: handler->__handlers = { <<array mapping names to ints } */
|
|
|
|
|
t = build1 (NOP_EXPR, build_pointer_type (handler_element_type),
|
|
|
|
|
build_chill_arrow_expr (start_handler_array (), 1));
|
|
|
|
|
expand_expr_stmt (build_chill_modify_expr (handlers_ref, t));
|
|
|
|
|
|
|
|
|
|
/* Emit code to unlink handler. */
|
|
|
|
|
if (inline_exception_stack_ops)
|
|
|
|
|
current_handler->unlink_cleanup
|
|
|
|
|
= build_chill_modify_expr (exception_stack_decl,
|
|
|
|
|
current_handler->handler_ref);
|
|
|
|
|
else
|
|
|
|
|
current_handler->unlink_cleanup
|
|
|
|
|
= build_chill_function_call (unlink_handler_decl,
|
|
|
|
|
build_tree_list(NULL_TREE,
|
|
|
|
|
current_handler->handler_ref));
|
|
|
|
|
cleanup_chain = tree_cons (build_int_2 (action_nesting_level, 0),
|
|
|
|
|
current_handler->unlink_cleanup,
|
|
|
|
|
cleanup_chain);
|
|
|
|
|
|
|
|
|
|
/* Emit code for setjmp. */
|
|
|
|
|
|
|
|
|
|
current_handler->setjmp_expr =
|
|
|
|
|
build_chill_function_call (BISJ, build_tree_list (NULL_TREE, jbuf_ref));
|
|
|
|
|
expand_start_case (1, current_handler->setjmp_expr,
|
|
|
|
|
integer_type_node, "on handler");
|
|
|
|
|
|
|
|
|
|
chill_handle_case_label (integer_zero_node, current_handler->setjmp_expr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Start emitting code for: <actions> ON <handlers> END.
|
|
|
|
|
Assume we've parsed <actions>, and the setup needed for it. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
chill_start_on ()
|
|
|
|
|
{
|
|
|
|
|
expand_expr_stmt (current_handler->unlink_cleanup);
|
|
|
|
|
|
|
|
|
|
/* Emit code to jump past the handlers. */
|
|
|
|
|
current_handler->end_label = gen_label_rtx ();
|
|
|
|
|
current_handler->compiling = 1;
|
|
|
|
|
emit_jump (current_handler->end_label);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
chill_finish_on ()
|
|
|
|
|
{
|
|
|
|
|
expand_end_case (current_handler->setjmp_expr);
|
|
|
|
|
|
|
|
|
|
finish_handler_array ();
|
|
|
|
|
|
|
|
|
|
emit_label (current_handler->end_label);
|
|
|
|
|
|
|
|
|
|
pop_momentary ();
|
|
|
|
|
|
|
|
|
|
cleanup_chain = TREE_CHAIN (cleanup_chain);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
chill_handle_on_labels (labels)
|
|
|
|
|
tree labels;
|
|
|
|
|
{
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
unsigned int alternative = ++current_handler->prev_on_alternative;
|
1998-08-27 22:51:39 +02:00
|
|
|
|
if (pass == 1)
|
|
|
|
|
{
|
|
|
|
|
tree handler_number = build_int_2 (alternative, 0);
|
|
|
|
|
current_handler->on_alt_list =
|
|
|
|
|
tree_cons (handler_number, labels, current_handler->on_alt_list);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Find handler_number saved in pass 1. */
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
tree tmp;
|
|
|
|
|
|
|
|
|
|
for (tmp = current_handler->on_alt_list;
|
|
|
|
|
compare_tree_int (TREE_PURPOSE (tmp), alternative) != 0;
|
|
|
|
|
tmp = TREE_CHAIN (tmp))
|
|
|
|
|
;
|
|
|
|
|
|
1998-08-27 22:51:39 +02:00
|
|
|
|
if (expand_exit_needed)
|
|
|
|
|
expand_exit_something (), expand_exit_needed = 0;
|
|
|
|
|
chill_handle_case_label (TREE_PURPOSE (tmp),
|
|
|
|
|
current_handler->setjmp_expr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
chill_start_default_handler ()
|
|
|
|
|
{
|
|
|
|
|
current_handler->else_handler = ++current_handler->prev_on_alternative;
|
|
|
|
|
if (!ignoring)
|
|
|
|
|
{
|
|
|
|
|
chill_handle_case_default ();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
chill_check_no_handlers ()
|
|
|
|
|
{
|
|
|
|
|
if (current_handler != NULL)
|
diagnostic.h (set_internal_error_function): Renamed.
* diagnostic.h (set_internal_error_function): Renamed.
* toplev.h (internal_error): Renamed from fatal.
(pfatal_with_name): Deleted.
(fatal_io_error): Now has printf-style arguments.
* diagnostic.c (pfatal_with_name): Deleted.
(fatal_io_error): Rework to have args in printf-style.
(set_internal_error_function): Renamed from set_fatal_function.
(internal_error): Renamed from fatal.
(error_recursion, fancy_abort): Call internal_error instead of fatal.
* dwarf2out.c (get_cfa_from_loc_descr): Likewise.
* emit-rtl.c (gen_realpart, gen_imagpart): Likewise.
* expr.c (check_max_integer_computation_mode, expand_expr): Likewise.
* flow.c (verify_flow_info): Likewise.
* config/arm/arm.c (thumb_unexpanded_epilogue): Likewise.
* config/mips/mips.c (save_restore_insns): Likewise.
* cp/init.c (build_java_class_ref): Likewise.
(dsp16xx_reg_class_from_letter): Likewise.
(limit_reload_class, double_reg_to_memory): Likewise.
(print_operand_address, emit_1600_code_shift): Likewise.
(gen_tst_reg, gen_compare_reg): Likewise.
* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
* cp/decl.c (pushdecl): Likewise.
* java/check-init.c (check_init): Likewise.
* java/expr.c (java_lang_expand_expr): Likewise.
* java/jcf-parse.c (get_constant): Likewise.
* java/mangle.c (java_mangle_decl): Likewise.
* java/parse.y (make_nested_class_name, java_complete_lhs): Likewise.
(operator_string): Likewise.
* except.c (duplicate_eh_handlers): Call abort instead of fatal.
* flow.c (verify_flow_info): Likewise.
* ch/convert.c (convert): Likewise.
* ch/except.c (pop_handler, chill_check_no_handlers): Likewise.
* ch/expr.c (chill_expand_expr): Likewise.
* ch/parse.c (peek_token_, pushback_token, require): Likewise.
* config/arm/arm.c (thumb_load_double_from_address): Likewise.
* config/avr/avr.c (pttreg_to_str, unique_section): Likewise.
(avr_normalize_condition): Likewise.
* config/c4x/c4x.c (c4x_emit_libcall, c4x_valid_operands): Likewise.
* config/dsp16xx/dsp16xx.c (dsp16xx_reg_class_from_letter): Likewise.
(limit_reload_class, double_reg_to_memory): Likewise.
(print_operand_address, emit_1600_code_shift): Likewise.
(gen_tst_reg, gen_compare_reg): Likewise.
* config/m68hc11/m68hc11.c (m68hc11_emit_libcall): Likewise.
* cp/decl.c (pushdecl): Likewise.
* java/check-init.c (check_init): Likewise.
* java/class.c (build_class_ref): Likewise.
* java/constants.c (write_constant_pool): Likewise.
* java/decl.c (start_java_method): Likewise.
* java/expr.c (push_type, java_stack_pop, java_stack_swap): Likewise.
(java_stack_dup, encode_newarray_type): Likewise.
(build_java_array_length_access): Likewise.
(build_java_check_indexed_type, expand_java_pushc): Likewise.
(build_java_soft_divmod, build_invokeinterface): Likewise.
* java/java-tree.h (INNER_CLASS_P): Likewise.
* java/jcf-parse.c (parse_signature, get_name_constant): Likewise.
(give_name_to_class, get_class_constant): Likewise.
* java/jcf-write.c (CHECK_PUT, CHECK_OP, get_access_flags): Likewise.
(find_constant_index, generate_bytecode_conditional): Likewise.
(generate_bytecode_insns, perform_relocations): Likewise.
* java/lex.c (java_unget_unicode, java_lex): Likewise.
* java/mangle.c (mangle_type, mangle_record_type): Likewise.
(mangle_pointer_type, mangle_array_type, init_mangling): Likewise.
(finish_mangling): Likewise.
* java/parse.h (MARK_FINAL_PARMS): Likewise.
* java/parse.y (pop_current_osb, unreachable_stmt_error): Likewise.
(obtain_incomplete_type, java_complete_class): Likewise.
(java_check_regular_methods, java_complete_expand_method): Likewise.
(cut_identifier_in_qualified, check_deprecation): Likewise.
(patch_invoke, find_applicable_accessible_methods_list): Likewise.
(java_complete_lhs, lookup_name_in_blocks): Likewise.
(check_final_variable_indirect_assignment, build_unaryop): Likewise.
* java/typeck.c (set_local_type, parse_signature_type): Likewise.
(parse_signature_string, build_java_signature): Likewise;
(set_java_signature): Likewise.
* java/verify.c (type_stack_dup, CHECK_PC_IN_RANGE): Likewise.
* c-parse.in (methoddef): Call fatal_error instead of fatal.
* objc/objc-act.c (build_ivar_chain): Likewise.
* cp/except.c (decl_is_java_type): Likewise.
* cp/init.c (build_java_class_ref): Likewise.
* cp/init.c (build_new_1): Likewise.
* f/com.c (ffecom_init_0): Likewise.
* java/class.c (add_method, build_static_field_ref): Likewise.
* java/expr.c (build_known_method_ref, expand_invoke): Likewise.
* java/jcf-parse.c (get_constant, jcf_parse): Likewise.
* java/lex.c (java_new_new_lexer): Likewise.
* java/jv-scan.c (main): Likewise.
(fatal_error): Renamed from fatal.
* dwarfout.c (dwarfout_init): Call fatal_io_error instead of
pfatal_with_name.
* graph.c (clean_graph_dump_file): Likewise.
* profile.c (init_branch_prob): Likewise.
* ch/grant.c (write_grant_file): Likewise.
* ch/lex.c (init_parse, same_file, yywrap): Likewise.
* f/com.c (init_parse): Likewise.
* java/jcf-parse.c (yyparse): Likewise.
* objc/objc-act.c (objc_init): Likewise.
* java/jcf-parse.c (jcf_parse_source): Call fatal_io_error, not fatal.
(yyparse): Likewise.
* java/jcf-write.c (make_class_file_name, write_classfile): Likewise.
* java/lex.c (java_get_line_col): Likewise.
* hash.c (hash_allocate): Don't check for failure returns from
obstack functions that can't fail.
(hash_table_init_n, hash_table_init): Likewise; also now return void.
* hash.h (hash_table_init_n, hash_table_init): Now return void.
* cp/decl.c (build_typename_type): hash_table_init now returns void.
* ch/lang.c (GNU_xref_begin, GNU_xref_end): Deleted.
* ch/lex.c (convert_bitstring): Delete check for alloca failure.
* config/dsp16xx/dsp16xx.c (dsp16xx_invalid_register_for_compare):
Deleted.
* config/dsp16xx/dsp16xx.md (unnamed cmphi): Call abort instead of it.
* f/com.c (ffecom_decode_include_option_): Make errors non-fatal.
* f/lex.c (ffelex_cfelex_, ffelex_get_directive_line_): Likewise.
(ffelex_hash_): Likewise.
* config/arm/arm.c (arm_override_options): Likewise.
* config/avr/avr.c (avr_override_options): Likewise.
* config/c4x/c4x.c (c4x_expand_prologue): Likewise.
* config/dsp16xx/dsp16xx.c (function_prologue): Likewise.
* config/h8300/h8300.c (h8300_init_once): Likewise.
* config/mips/mips.c (override_options): Likewise.
* config/i386/i386.c (override_options): Likewise, rework.
* config/m68k/m68k.c (override_options): Likewise.
* cp/decl.c (init_decl_processing): Likewise.
* java/jcf-parse.c (load_class): Likewise.
* config/dsp16xx/dsp16xx.c (print_operand): Call output_operand_lossage
instead of fatal.
* config/mips/mips.c (print_operand): Likewise.
* java/lex.c (byteswap_init, need_byteswap): Only #ifdef HAVE_ICONV.
* objc/objc_act.c (objc_check_decl): Remove unneeded fatal call.
(get_object_reference): Likewise.
From-SVN: r39444
2001-02-05 00:18:43 +01:00
|
|
|
|
abort ();
|
1998-08-27 22:51:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
initialize_exceptions ()
|
|
|
|
|
{
|
|
|
|
|
tree jmp_buf_type = build_array_type (integer_type_node,
|
|
|
|
|
build_index_type (build_int_2 (_JBLEN_2-1, 0)));
|
|
|
|
|
tree setjmp_fndecl, link_ftype;
|
|
|
|
|
tree parmtypes
|
|
|
|
|
= tree_cons (NULL_TREE, build_pointer_type (jmp_buf_type), void_list_node);
|
|
|
|
|
|
|
|
|
|
setjmp_fndecl = builtin_function ("setjmp",
|
|
|
|
|
build_function_type (integer_type_node,
|
|
|
|
|
parmtypes),
|
1999-09-24 12:07:04 +02:00
|
|
|
|
0, NOT_BUILT_IN,
|
1998-08-27 22:51:39 +02:00
|
|
|
|
SETJMP_LIBRARY_NAME);
|
|
|
|
|
BISJ = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (setjmp_fndecl)),
|
|
|
|
|
setjmp_fndecl);
|
|
|
|
|
|
|
|
|
|
char_pointer_type_for_handler
|
|
|
|
|
= build_pointer_type (build_type_variant (char_type_node, 1, 0));
|
|
|
|
|
handler_element_type =
|
|
|
|
|
build_chill_struct_type (chainon
|
|
|
|
|
(build_decl (FIELD_DECL,
|
|
|
|
|
get_identifier("__exceptid"),
|
|
|
|
|
char_pointer_type_for_handler),
|
|
|
|
|
build_decl (FIELD_DECL,
|
|
|
|
|
get_identifier("__handlerno"),
|
|
|
|
|
integer_type_node)));
|
|
|
|
|
|
|
|
|
|
jbuf_ident = get_identifier("__jbuf");
|
|
|
|
|
prev_ident = get_identifier("__prev");
|
|
|
|
|
handlers_ident = get_identifier("__handlers");
|
|
|
|
|
|
|
|
|
|
handler_link_type =
|
|
|
|
|
build_chill_struct_type
|
|
|
|
|
(chainon
|
|
|
|
|
(build_decl (FIELD_DECL, prev_ident, ptr_type_node),
|
|
|
|
|
chainon
|
|
|
|
|
(build_decl (FIELD_DECL, handlers_ident,
|
|
|
|
|
build_pointer_type (handler_element_type)),
|
|
|
|
|
build_decl (FIELD_DECL, jbuf_ident, jmp_buf_type))));
|
|
|
|
|
|
|
|
|
|
handler_link_pointer_type = build_pointer_type (handler_link_type);
|
|
|
|
|
|
|
|
|
|
if (inline_exception_stack_ops)
|
|
|
|
|
{
|
|
|
|
|
exception_stack_decl =
|
|
|
|
|
build_lang_decl (VAR_DECL,
|
|
|
|
|
get_identifier("__exceptionStack"),
|
|
|
|
|
handler_link_pointer_type);
|
|
|
|
|
TREE_STATIC (exception_stack_decl) = 1;
|
|
|
|
|
TREE_PUBLIC (exception_stack_decl) = 1;
|
|
|
|
|
DECL_EXTERNAL (exception_stack_decl) = 1;
|
|
|
|
|
push_obstacks_nochange ();
|
|
|
|
|
pushdecl(exception_stack_decl);
|
|
|
|
|
make_decl_rtl (exception_stack_decl, NULL_PTR, 1);
|
|
|
|
|
finish_decl (exception_stack_decl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
link_ftype = build_function_type (void_type_node,
|
|
|
|
|
tree_cons (NULL_TREE,
|
|
|
|
|
handler_link_pointer_type,
|
|
|
|
|
void_list_node));
|
|
|
|
|
link_handler_decl = builtin_function ("__ch_link_handler", link_ftype,
|
1999-09-24 12:07:04 +02:00
|
|
|
|
0, NOT_BUILT_IN, NULL_PTR);
|
1998-08-27 22:51:39 +02:00
|
|
|
|
unlink_handler_decl = builtin_function ("__ch_unlink_handler", link_ftype,
|
1999-09-24 12:07:04 +02:00
|
|
|
|
0, NOT_BUILT_IN, NULL_PTR);
|
1998-08-27 22:51:39 +02:00
|
|
|
|
|
|
|
|
|
exceptions_initialized = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Do the cleanup(s) needed for a GOTO label.
|
|
|
|
|
We only need to do the last of the cleanups. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
expand_goto_except_cleanup (label_level)
|
|
|
|
|
int label_level;
|
|
|
|
|
{
|
|
|
|
|
tree list = cleanup_chain;
|
|
|
|
|
tree last = NULL_TREE;
|
|
|
|
|
for ( ; list != NULL_TREE; list = TREE_CHAIN (list))
|
|
|
|
|
{
|
tree.h (INT_CST_LT, [...]): Remove unneeded casts.
* tree.h (INT_CST_LT, INT_CST_LT_UNSIGNED): Remove unneeded casts.
(struct tree_int_cst): int_cst_low is now unsigned HOST_WIDE_INT.
(attribute_hash_list, type_hash_canon): hashcode is now unsigned.
(type_hash_lookup, type_hash_add, type_hash_list): Likewise.
(min_precision): Result is unsignd.
(add_double, neg_double, mul_double): Low word is unsigned.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double): Likewise.
(tree_floor_log2, compare_tree_int): New functions.
(preserve_rtl_expr_temps): New declaration.
* c-common.c (declare_hidden_char_array): Use compare_tree_int.
(decl_attributes): Use tree_log2 to find alignment.
Check for TREE_INT_CST_HIGH for format args.
(min_precision): Now unsigned.
Use tree_floor_log2.
(truthvalue_conversion): Delete long-disabled code.
* c-decl.c (finish_struct): Clean up tests on field width.
(finish_function): Use compare_tree_int.
* c-pragma.c (handle_pragma_token): Use tree_log2 for alignment.
* c-typeck.c (comptypes): Use tree_int_cst_equal.
(default_conversion, digest_init): Use compare_tree_int.
(build_binary_op): Use integer_all_onesp and compare_tree_int.
Fix type errors in forming masks.
* calls.c (initialize_argument_information): Use compare_tree_int.
* dbxout.c (dbxout_type): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* except.c (expand_eh_region_start_tree): Use compare_tree_int.
* expr.c (is_zeros_p, case INTEGER_CST): Use integer_zerop.
(store_field): Use compare_tree_int.
(expand_expr, case CONSTRUCTOR): Use TYPE_SIZE_UNIT.
(expand_expr, case ARRAY_REF): Use compare_tree_int.
(do_jump, case BIT_AND_EXPR): Use tree_floor_log2.
(do_store_flag): Use compare_tree_int.
* fold-const.c (encode, decode): Low part is always unsigned.
(force_fit_type, add_double, neg_double, mul_double): Likewise.
(lshift_double, rshift_double, lrotate_double): Likewise.
(rrotate_double, div_and_round_double, int_const_binop): Likewise.
(fold_convert): Use compare_tree_int.
(operand_equal_p, case INTEGER_CST): Use tree_int_cst_equal.
(invert_truthvalue, case INTEGER_CST): Likewise.
(fold): Use compare_tree_int; add casts for unsigned TREE_INT_CST_LOW.
* mkdeps.c (deps_dummy_targets): Make I unsigned.
* rtl.h (add_double, neg_double, mul_double): Low words are unsigned.
(lshift_double, rshift_double, lrotate_double, rrotate_double):
Likewise.
* stmt.c (expand_decl): Use compare_tree_int and mode_for_size_tree.
(expand_end_case): Use compare_tree_int.
(estimate_case_costs): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* stor-layout.c (mode_for_size_tree): Use compare_tree_int.
(layout_decl): Likewise.
(layout_record, layout_union): Make sizes unsigned.
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
(layout_type, case QUAL_UNION_TYPE): Use compare_tree_int.
* tree.c (struct type_hash): hashcode is unsigned.
(build_type_attribute_variant, type_hash_list): Likewise.
(type_hash_lookup, type_hash_add, type_hash_canon): Likewise.
(attribute_hash_list, build_array_type, build_method_type): Likewise.
(build_complex_type): Likewise.
(real_value_from_int_cst): Remove unneeded casts.
(integer_all_onesp): Add casts.
(tree_floor_log2, compare_tree_int): New functions.
(build_index_type): Use tree_int_cst_sgn.
* varasm.c (assemble_variable): Use compare_tree_int.
* ch/actions.c (chill_convert_for_assignment): INDEX is unsigned
HOST_WIDE_INT.
* ch/ch-tree.h (DECL_NESTING_LEVEL): Use TREE_INT_CST_HIGH
since unsigned.
* ch/except.c (chill_handle_on_labels): ALTERNATIVE is unsigned.
Use compare_tree_int.
(expand_goto_except_cleanup): Likewise.
* cp/class.c (dfs_modify_vtables): I is now unsigned.
(check_bitfield_decl): Use tree_int_cst_sgn and compare_tree_int.
(build_base_field): Add casts of TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/error.c (dump_expr): Cast TREE_INT_CST_HIGH to unsigned.
* cp/init.c (build_vec_init): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
* cp/method.c (build_overload_int): Cast TREE_INT_CST_HIGH to unsigned.
* cp/typeck.c (build_binary_op, case TRUNC_DIV_EXPR):
Call integer_all_onesp.
* cp/typeck2.c (process_init_constructor): Use compare_tree_int.
* f/com.c (ffecom_f2c_set_lio_code_): Use compare_tree_int.
(ffecom_sym_transform_, ffecom_transform_common_): Likewise.
(ffecom_transform_equiv_): Likewise.
* java/decl.c (emit_init_test_initialization): Mark KEY as unused.
* java/expr.c (build_newarray): Cast TREE_INT_CST_LOW to HOST_WIDE_INT.
(build_anewarray): Likewise.
* java/parse.y (patch_newarray): Likewise.
* java/parse.c: Regenerated.
From-SVN: r32383
2000-03-07 12:41:32 +01:00
|
|
|
|
if (compare_tree_int (TREE_PURPOSE (list), label_level) > 0)
|
1998-08-27 22:51:39 +02:00
|
|
|
|
last = list;
|
|
|
|
|
else
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (last)
|
|
|
|
|
expand_expr_stmt (TREE_VALUE (last));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Returns true if there is a valid handler for EXCEPT_NAME
|
|
|
|
|
in the current static scope.
|
|
|
|
|
0 ... no handler found
|
|
|
|
|
1 ... local handler available
|
|
|
|
|
2 ... function may propagate this exception
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
is_handled (except_name)
|
|
|
|
|
tree except_name;
|
|
|
|
|
{
|
|
|
|
|
tree t;
|
|
|
|
|
struct handler_state *h = current_handler;
|
|
|
|
|
|
|
|
|
|
/* if we are are currently compiling this handler
|
|
|
|
|
we have to start at the next level */
|
|
|
|
|
if (h && h->compiling)
|
|
|
|
|
h = h->next;
|
|
|
|
|
while (h != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (h->function != current_function_decl)
|
|
|
|
|
break;
|
|
|
|
|
if (h->else_handler > 0)
|
|
|
|
|
return 1;
|
|
|
|
|
for (t = h->on_alt_list; t != NULL_TREE; t = TREE_CHAIN (t))
|
|
|
|
|
{
|
|
|
|
|
if (value_member (except_name, TREE_VALUE (t)))
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
h = h->next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
t = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (current_function_decl));
|
|
|
|
|
|
|
|
|
|
if (value_member (except_name, t))
|
|
|
|
|
return 2;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* function generates code to reraise exceptions
|
|
|
|
|
for PROC's propagating exceptions. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
chill_reraise_exceptions (exceptions)
|
|
|
|
|
tree exceptions;
|
|
|
|
|
{
|
|
|
|
|
tree wrk;
|
|
|
|
|
|
|
|
|
|
if (exceptions == NULL_TREE)
|
|
|
|
|
return; /* just in case */
|
|
|
|
|
|
|
|
|
|
if (pass == 1)
|
|
|
|
|
{
|
|
|
|
|
for (wrk = exceptions; wrk != NULL_TREE; wrk = TREE_CHAIN (wrk))
|
|
|
|
|
chill_handle_on_labels (build_tree_list (NULL_TREE, TREE_VALUE (wrk)));
|
|
|
|
|
}
|
|
|
|
|
else /* pass == 2 */
|
|
|
|
|
{
|
|
|
|
|
chill_start_on ();
|
|
|
|
|
expand_exit_needed = 0;
|
|
|
|
|
|
|
|
|
|
for (wrk = exceptions; wrk != NULL_TREE; wrk = TREE_CHAIN (wrk))
|
|
|
|
|
{
|
|
|
|
|
chill_handle_on_labels (TREE_VALUE (wrk));
|
|
|
|
|
/* do a CAUSE exception */
|
|
|
|
|
expand_expr_stmt (build_cause_exception (TREE_VALUE (wrk), 0));
|
|
|
|
|
expand_exit_needed = 1;
|
|
|
|
|
}
|
|
|
|
|
chill_finish_on ();
|
|
|
|
|
}
|
|
|
|
|
pop_handler (1);
|
|
|
|
|
}
|