+Thu Dec 28 11:13:15 1995 Mike Stump <mrs@cygnus.com>
+
+ * except.c (expand_builtin_throw): Use RETURN_ADDR_OFFSET instead of
+ NORMAL_RETURN_ADDR_OFFSET.
+ (end_eh_unwinder): Ditto.
+
+Wed Dec 27 22:18:16 1995 Mike Stump <mrs@cygnus.com>
+
+ * gc.c (build_dynamic_cast): Make sure we don't cast away const
+ when dealing with references, and make sure we handle dynamic
+ casting to a cv qualified reference.
+
+Thu Dec 21 23:50:35 1995 Mike Stump <mrs@cygnus.com>
+
+ * except.c (struct eh_context): New structure top hold eh context
+ information.
+ (push_eh_context): New routine.
+ (pop_eh_context): Ditto.
+ * decl.c (push_cp_function_context): Use them.
+ (pop_cp_function_context): Ditto.
+
+Wed Dec 20 12:42:51 1995 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (finish_file): Also prune uninteresting functions in the
+ inline emission loop.
+
+Wed Dec 20 02:32:07 1995 Jeffrey A Law (law@cygnus.com)
+
+ * sig.c (build_signature_table_constructor): Mark functions
+ in the signature as referenced.
+
+Tue Dec 19 22:36:56 1995 Jason Merrill <jason@yorick.cygnus.com>
+
+ * decl2.c (finish_file): Do all the vtable/synthesis stuff before
+ the inline emission stuff.
+
Mon Dec 18 15:51:33 1995 Jason Merrill <jason@yorick.cygnus.com>
* cp-tree.h, decl2.c (flag_weak): New flag to control the use of
* parse.y (fn.def1): Call split_specs_attrs in
declmods notype_declarator case.
-Mon Nov 20 14:06:28 1995 Mike Stump <mrs@cygnus.com>
+Sun Nov 26 14:47:42 1995 Richard Kenner <kenner@mole.gnu.ai.mit.edu>
* Version 2.7.2 released.
* init.c (expand_aggr_init): Handle cv qualifiers on the object's
type.
-Sun Nov 12 18:09:35 1995 Mike Stump <mrs@cygnus.com>
+Sat Nov 11 08:25:55 1995 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* Version 2.7.1 released.
static tree lookup_nested_type PROTO((tree, tree));
static char *redeclaration_error_message PROTO((tree, tree));
static void grok_op_properties PROTO((tree, int, int));
+extern void* push_eh_context PROTO(());
+extern void pop_eh_context PROTO((void *));
tree define_function
PROTO((char *, tree, enum built_in_function, void (*)(), char *));
rtx result_rtx;
struct cp_function *next;
struct binding_level *binding_level;
+ void* eh_context;
};
+
+
struct cp_function *cp_function_chain;
extern int temp_name_counter;
p->member_init_list = current_member_init_list;
p->class_decl = current_class_decl;
p->C_C_D = C_C_D;
+
+ p->eh_context = push_eh_context ();
}
/* Restore the variables used during compilation of a C++ function. */
current_class_decl = p->class_decl;
C_C_D = p->C_C_D;
+ pop_eh_context (p->eh_context);
+
free (p);
}
while (reconsider)
{
- tree last = saved_inlines = tree_cons (NULL_TREE, NULL_TREE,
- saved_inlines);
- tree last_head = last;
- tree place = TREE_CHAIN (saved_inlines);
+ tree *p = &saved_inlines;
reconsider = 0;
walk_vtables ((void (*)())0, finish_vtable_vardecl);
- for (; place; place = TREE_CHAIN (place))
+ while (*p)
{
- tree decl = TREE_VALUE (place);
+ tree decl = TREE_VALUE (*p);
- /* Slice out the empty elements put in just above in the
- previous reconsidering. */
- if (decl == NULL_TREE)
+ if (DECL_ARTIFICIAL (decl) && ! DECL_INITIAL (decl)
+ && TREE_USED (decl))
{
- TREE_CHAIN (last) = TREE_CHAIN (place);
- continue;
+ synthesize_method (decl);
+ reconsider = 1;
}
- if (DECL_ARTIFICIAL (decl) && ! DECL_INITIAL (decl))
- {
- if (TREE_USED (decl))
- {
- synthesize_method (decl);
- if (TREE_ASM_WRITTEN (decl))
- reconsider = 1;
- }
- else
- {
- last = place;
- continue;
- }
- }
+ if (TREE_ASM_WRITTEN (decl)
+ || (DECL_SAVED_INSNS (decl) == 0 && ! DECL_ARTIFICIAL (decl)))
+ *p = TREE_CHAIN (*p);
+ else
+ p = &TREE_CHAIN (*p);
+ }
+ }
- if (TREE_ASM_WRITTEN (decl) || DECL_SAVED_INSNS (decl) == 0)
- {
- TREE_CHAIN (last) = TREE_CHAIN (place);
- continue;
- }
+ reconsider = 1; /* More may be referenced; check again */
+ while (reconsider)
+ {
+ tree *p = &saved_inlines;
+ reconsider = 0;
- if ((TREE_PUBLIC (decl) && ! DECL_WEAK (decl))
- || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
- || flag_keep_inline_functions)
- {
- TREE_CHAIN (last) = TREE_CHAIN (place);
+ while (*p)
+ {
+ tree decl = TREE_VALUE (*p);
+ if (TREE_ASM_WRITTEN (decl) || DECL_SAVED_INSNS (decl) == 0)
+ *p = TREE_CHAIN (*p);
+ else if ((TREE_PUBLIC (decl) && ! DECL_WEAK (decl))
+ || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
+ || flag_keep_inline_functions)
+ {
if (DECL_NOT_REALLY_EXTERN (decl))
{
DECL_EXTERNAL (decl) = 0;
permanent_allocation (1);
}
- continue;
+ *p = TREE_CHAIN (*p);
}
-
- last = place;
+ else
+ p = &TREE_CHAIN (*p);
}
}
}
#include "flags.h"
#include "obstack.h"
#include "expr.h"
+#include "output.h"
tree protect_list;
int throw_used;
static rtx catch_clauses;
-static first_catch_label;
static struct ehStack ehstack;
static struct ehQueue ehqueue;
static struct ehEntry *copy_eh_entry PROTO((struct ehEntry *entry));
+/* Routines to save and restore eh context information. */
+struct eh_context {
+ struct ehStack ehstack;
+ struct ehQueue ehqueue;
+ rtx catch_clauses;
+ struct labelNode *false_label_stack;
+ struct labelNode *caught_return_label_stack;
+ tree protect_list;
+};
+
+/* Save the context and push into a new one. */
+void*
+push_eh_context ()
+{
+ struct eh_context *p
+ = (struct eh_context*)xmalloc (sizeof (struct eh_context));
+
+ p->ehstack = ehstack;
+ p->ehqueue = ehqueue;
+ p->catch_clauses = catch_clauses;
+ p->false_label_stack = false_label_stack;
+ p->caught_return_label_stack = caught_return_label_stack;
+ p->protect_list = protect_list;
+
+ new_eh_stack (&ehstack);
+ new_eh_queue (&ehqueue);
+ catch_clauses = NULL_RTX;
+ false_label_stack = NULL;
+ caught_return_label_stack = NULL;
+ protect_list = NULL_TREE;
+
+ return p;
+}
+
+/* Pop and restore the context. */
+void
+pop_eh_context (vp)
+ void *vp;
+{
+ struct eh_context *p = (struct eh_context *)vp;
+
+ protect_list = p->protect_list;
+ caught_return_label_stack = p->caught_return_label_stack;
+ false_label_stack = p->false_label_stack;
+ catch_clauses = p->catch_clauses;
+ ehqueue = p->ehqueue;
+ ehstack = p->ehstack;
+
+ free (p);
+}
+
+
/* All my cheesy stack/queue/misc data structure handling routines
/* Set it up so that we continue inside, at the top of the loop. */
emit_move_insn (ret_val, gen_rtx (LABEL_REF, Pmode, top_of_loop));
-#ifdef NORMAL_RETURN_ADDR_OFFSET
- return_val_rtx = plus_constant (ret_val, -NORMAL_RETURN_ADDR_OFFSET);
+#ifdef RETURN_ADDR_OFFSET
+ return_val_rtx = plus_constant (ret_val, -RETURN_ADDR_OFFSET);
if (return_val_rtx != ret_val)
emit_move_insn (ret_val, return_val_rtx);
#endif
void
expand_exception_blocks ()
{
- static rtx funcend;
+ rtx funcend;
rtx insns;
start_sequence ();
ret_val = expand_builtin_return_addr (BUILT_IN_RETURN_ADDRESS,
0, hard_frame_pointer_rtx);
return_val_rtx = copy_to_reg (ret_val);
-#ifdef NORMAL_RETURN_ADDR_OFFSET
- return_val_rtx = plus_constant (return_val_rtx, NORMAL_RETURN_ADDR_OFFSET-1);
+#ifdef RETURN_ADDR_OFFSET
+ return_val_rtx = plus_constant (return_val_rtx, RETURN_ADDR_OFFSET-1);
#else
return_val_rtx = plus_constant (return_val_rtx, -1);
#endif
emit_move_insn (ret_val, gen_rtx (LABEL_REF, Pmode, label));
#endif
-#ifdef NORMAL_RETURN_ADDR_OFFSET
- return_val_rtx = plus_constant (ret_val, -NORMAL_RETURN_ADDR_OFFSET);
+#ifdef RETURN_ADDR_OFFSET
+ return_val_rtx = plus_constant (ret_val, -RETURN_ADDR_OFFSET);
if (return_val_rtx != ret_val)
emit_move_insn (ret_val, return_val_rtx);
#endif
delta = integer_zero_node;
index = integer_zero_node;
pfn = build_unary_op (ADDR_EXPR, rhs_method, 0);
+ TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (rhs_method)) = 1;
TREE_TYPE (pfn) = ptr_type_node;
TREE_ADDRESSABLE (rhs_method) = 1;
offset_p = 0; /* we can't offset the rhs sig table */
rhstype, 1));
index = integer_zero_node;
pfn = build_unary_op (ADDR_EXPR, rhs_method, 0);
+ TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (rhs_method)) = 1;
TREE_TYPE (pfn) = ptr_type_node;
TREE_ADDRESSABLE (rhs_method) = 1;
}