static void genrtl_try_block PARAMS ((tree));
static void genrtl_eh_spec_block PARAMS ((tree));
static void genrtl_handler PARAMS ((tree));
-static void genrtl_catch_block PARAMS ((tree));
static void genrtl_ctor_stmt PARAMS ((tree));
static void genrtl_subobject PARAMS ((tree));
static void genrtl_named_return_value PARAMS ((void));
RECHAIN_STMTS (if_stmt, ELSE_CLAUSE (if_stmt));
}
-/* Finsh an if-statement. */
+/* Finish an if-statement. */
void
finish_if_stmt ()
{
/* Similarly, all destructors must run destructors for
base-classes before returning. So, all returns in a
- destructor get sent to the DTOR_LABEL; finsh_function emits
+ destructor get sent to the DTOR_LABEL; finish_function emits
code to return a value there. */
return finish_goto_stmt (dtor_label);
}
tree t;
{
genrtl_do_pushlevel ();
+ if (!processing_template_decl)
+ expand_start_catch (HANDLER_TYPE (t));
expand_stmt (HANDLER_BODY (t));
if (!processing_template_decl)
expand_end_catch ();
tree r;
r = build_stmt (HANDLER, NULL_TREE, NULL_TREE);
add_stmt (r);
+ /* Create a binding level for the eh_info and the exception object
+ cleanup. */
do_pushlevel ();
+ note_level_for_catch ();
return r;
}
HANDLER. DECL is the declaration for the catch parameter, or NULL
if this is a `catch (...)' clause. */
-tree
+void
finish_handler_parms (decl, handler)
tree decl;
tree handler;
{
- tree blocks = NULL_TREE;
-
+ tree type = NULL_TREE;
if (processing_template_decl)
{
if (decl)
decl = push_template_decl (decl);
add_decl_stmt (decl);
RECHAIN_STMTS (handler, HANDLER_PARMS (handler));
+ type = TREE_TYPE (decl);
}
}
else
- blocks = expand_start_catch_block (decl);
-
- if (decl)
- TREE_TYPE (handler) = TREE_TYPE (decl);
+ type = expand_start_catch_block (decl);
- return blocks;
-}
-
-/* Generate the RTL for a START_CATCH_STMT. */
-
-static void
-genrtl_catch_block (type)
- tree type;
-{
- expand_start_catch (type);
-}
-
-/* Note the beginning of a handler for TYPE. This function is called
- at the point to which control should be transferred when an
- appropriately-typed exception is thrown. */
-
-void
-begin_catch_block (type)
- tree type;
-{
- add_stmt (build (START_CATCH_STMT, type));
+ HANDLER_TYPE (handler) = type;
}
/* Finish a handler, which may be given by HANDLER. The BLOCKs are
the return value from the matching call to finish_handler_parms. */
void
-finish_handler (blocks, handler)
- tree blocks;
+finish_handler (handler)
tree handler;
{
if (!processing_template_decl)
- expand_end_catch_block (blocks);
+ expand_end_catch_block ();
do_poplevel ();
RECHAIN_STMTS (handler, HANDLER_BODY (handler));
}
to accidentally keep a block *inside* the scopeless block. */
keep_next_level (0);
- /* If this is the outermost block of the function, declare the
- variables __FUNCTION__, __PRETTY_FUNCTION__, and so forth. */
- if (cfun
- && !function_name_declared_p
- && !has_no_scope)
- {
- function_name_declared_p = 1;
- declare_function_name ();
- }
-
return r;
}
{
tree if_stmt;
tree compound_stmt;
- int saved_cfnd;
/* If the dtor is empty, and we know there is not any possible
way we could use any vtable entries, before they are possibly
finish_if_stmt_cond (boolean_true_node, if_stmt);
current_vcalls_possible_p = &IF_COND (if_stmt);
- /* Don't declare __PRETTY_FUNCTION__ and friends here when we
- open the block for the if-body. */
- saved_cfnd = function_name_declared_p;
- function_name_declared_p = 1;
compound_stmt = begin_compound_stmt (/*has_no_scope=*/0);
- function_name_declared_p = saved_cfnd;
/* Make all virtual function table pointers in non-virtual base
classes point to CURRENT_CLASS_TYPE's virtual function
args);
}
-/* Finish an expression taking the address of LABEL. Returns an
- expression for the address. */
-
-tree
-finish_label_address_expr (label)
- tree label;
-{
- tree result;
-
- label = lookup_label (label);
- if (label == NULL_TREE)
- result = null_pointer_node;
- else
- {
- TREE_USED (label) = 1;
- result = build1 (ADDR_EXPR, ptr_type_node, label);
- TREE_CONSTANT (result) = 1;
- /* This function cannot be inlined. All jumps to the addressed
- label should wind up at the same point. */
- DECL_UNINLINABLE (current_function_decl) = 1;
- }
-
- return result;
-}
-
/* Finish an expression of the form CODE EXPR. */
tree
pop_everything ();
while (current_namespace != global_namespace)
pop_namespace ();
+
+ /* Do file scope __FUNCTION__ et al. */
+ finish_fname_decls ();
+
finish_file ();
}
/* Reset the interface data, at the earliest possible
moment, as it might have been set via a class foo;
before. */
- {
- tree name = TYPE_IDENTIFIER (t);
-
- if (! ANON_AGGRNAME_P (name))
- {
- CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
- SET_CLASSTYPE_INTERFACE_UNKNOWN_X
- (t, interface_unknown);
- }
- }
+ if (! TYPE_ANONYMOUS_P (t))
+ {
+ CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
+ SET_CLASSTYPE_INTERFACE_UNKNOWN_X
+ (t, interface_unknown);
+ }
reset_specialization();
/* Make a declaration for this class in its own scope. */
A C language linkage is ignored for the names of class members
and the member function type of class member functions. */
if (DECL_LANG_SPECIFIC (decl) && DECL_LANGUAGE (decl) == lang_c)
- DECL_LANGUAGE (decl) = lang_cplusplus;
+ SET_DECL_LANGUAGE (decl, lang_cplusplus);
/* Put functions on the TYPE_METHODS list and everything else on the
TYPE_FIELDS list. Note that these are built up in reverse order.
genrtl_decl_cleanup (CLEANUP_DECL (t), CLEANUP_EXPR (t));
break;
- case START_CATCH_STMT:
- genrtl_catch_block (TREE_TYPE (t));
- break;
-
case CTOR_STMT:
genrtl_ctor_stmt (t);
break;
genrtl_named_return_value ();
break;
+ case USING_STMT:
+ break;
+
default:
my_friendly_abort (19990810);
break;
#ifdef PCC_STATIC_STRUCT_RETURN
if (!AGGR_INIT_VIA_CTOR_P (aggr_init_expr) && aggregate_value_p (type))
{
- int old_ac;
+ int old_ac = flag_access_control;
flag_access_control = 0;
call_expr = build_aggr_init (slot, call_expr, LOOKUP_ONLYCONVERTING);
timevar_push (TV_INTEGRATION);
- /* Optimize the body of the function before expanding it. */
- optimize_function (fn);
+ /* Optimize the body of the function before expanding it. We do not
+ optimize thunks, as (1) the backend tries to optimize the call to
+ the thunkee, (b) the tree based inliner breaks that optimization,
+ (c) virtual functions are rarely inlineable, and (d)
+ ASM_OUTPUT_MI_THUNK is there to DTRT anyway. */
+ if (!DECL_THUNK_P (fn))
+ optimize_function (fn);
timevar_pop (TV_INTEGRATION);
timevar_push (TV_EXPAND);
genrtl_start_function (fn);
current_function_is_thunk = DECL_THUNK_P (fn);
- /* We don't need to redeclare __FUNCTION__, __PRETTY_FUNCTION__, or
- any of the other magic variables we set up when starting a
- function body. */
- function_name_declared_p = 1;
-
/* Expand the body. */
expand_stmt (DECL_SAVED_TREE (fn));
/* If possible, obliterate the body of the function so that it can
be garbage collected. */
- if (flag_dump_translation_unit)
+ if (dump_enabled_p (TDI_all))
/* Keep the body; we're going to dump it. */
;
else if (DECL_INLINE (fn) && flag_inline_trees)