Commit 5cc3d3b8 by Gabriel Dos Reis Committed by Gabriel Dos Reis

except.c (init_exception_processing): Use C90 prototype style.

        * except.c (init_exception_processing): Use C90 prototype style.
        (cp_protect_cleanup_actions): Likewise.
        (prepare_eh_type): Likewise.
        (build_eh_type_type): Likewise.
        (build_exc_ptr): Likewise.
        (do_begin_catch): Likewise.
        (dtor_nothrow): Likewise.
        (do_end_catch): Likewise.
        (push_eh_cleanup): Likewise.
        (decl_is_java_type): Likewise.
        (choose_personality_routine): Likewise.
        (initialize_handler_parm): Likewise.
        (expand_start_catch_block): Likewise.
        (expand_end_catch_block): Likewise.
        (begin_eh_spec_block): Likewise.
        (finish_eh_spec_block): Likewise.
        (do_allocate_exception): Likewise.
        (do_free_exception): Likewise.
        (wrap_cleanups_r): Likewise.
        (stabilize_throw_expr): Likewise.
        (build_throw): Likewise.
        (complete_ptr_ref_or_void_ptr_p): Likewise.
        (is_admissible_throw_operand): Likewise.
        (nothrow_libfn_p): Likewise.
        (can_convert_eh): Likewise.
        (check_handlers_1): Likewise.
        (check_handlers): Likewise.

From-SVN: r63935
parent 9534f4bc
2003-03-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
* except.c (init_exception_processing): Use C90 prototype style.
(cp_protect_cleanup_actions): Likewise.
(prepare_eh_type): Likewise.
(build_eh_type_type): Likewise.
(build_exc_ptr): Likewise.
(do_begin_catch): Likewise.
(dtor_nothrow): Likewise.
(do_end_catch): Likewise.
(push_eh_cleanup): Likewise.
(decl_is_java_type): Likewise.
(choose_personality_routine): Likewise.
(initialize_handler_parm): Likewise.
(expand_start_catch_block): Likewise.
(expand_end_catch_block): Likewise.
(begin_eh_spec_block): Likewise.
(finish_eh_spec_block): Likewise.
(do_allocate_exception): Likewise.
(do_free_exception): Likewise.
(wrap_cleanups_r): Likewise.
(stabilize_throw_expr): Likewise.
(build_throw): Likewise.
(complete_ptr_ref_or_void_ptr_p): Likewise.
(is_admissible_throw_operand): Likewise.
(nothrow_libfn_p): Likewise.
(can_convert_eh): Likewise.
(check_handlers_1): Likewise.
(check_handlers): Likewise.
2003-03-06 Mark Mitchell <mark@codesourcery.com> 2003-03-06 Mark Mitchell <mark@codesourcery.com>
* call.c (merge_conversion_sequences): New function. * call.c (merge_conversion_sequences): New function.
......
...@@ -38,29 +38,29 @@ Boston, MA 02111-1307, USA. */ ...@@ -38,29 +38,29 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h" #include "toplev.h"
#include "tree-inline.h" #include "tree-inline.h"
static void push_eh_cleanup PARAMS ((tree)); static void push_eh_cleanup (tree);
static tree prepare_eh_type PARAMS ((tree)); static tree prepare_eh_type (tree);
static tree build_eh_type_type PARAMS ((tree)); static tree build_eh_type_type (tree);
static tree do_begin_catch PARAMS ((void)); static tree do_begin_catch (void);
static int dtor_nothrow PARAMS ((tree)); static int dtor_nothrow (tree);
static tree do_end_catch PARAMS ((tree)); static tree do_end_catch (tree);
static void push_eh_cleanup PARAMS ((tree)); static void push_eh_cleanup (tree);
static bool decl_is_java_type PARAMS ((tree decl, int err)); static bool decl_is_java_type (tree decl, int err);
static void initialize_handler_parm PARAMS ((tree, tree)); static void initialize_handler_parm (tree, tree);
static tree do_allocate_exception PARAMS ((tree)); static tree do_allocate_exception (tree);
static tree stabilize_throw_expr PARAMS ((tree, tree *)); static tree stabilize_throw_expr (tree, tree *);
static tree wrap_cleanups_r PARAMS ((tree *, int *, void *)); static tree wrap_cleanups_r (tree *, int *, void *);
static int complete_ptr_ref_or_void_ptr_p PARAMS ((tree, tree)); static int complete_ptr_ref_or_void_ptr_p (tree, tree);
static bool is_admissible_throw_operand PARAMS ((tree)); static bool is_admissible_throw_operand (tree);
static int can_convert_eh PARAMS ((tree, tree)); static int can_convert_eh (tree, tree);
static void check_handlers_1 PARAMS ((tree, tree)); static void check_handlers_1 (tree, tree);
static tree cp_protect_cleanup_actions PARAMS ((void)); static tree cp_protect_cleanup_actions (void);
/* Sets up all the global eh stuff that needs to be initialized at the /* Sets up all the global eh stuff that needs to be initialized at the
start of compilation. */ start of compilation. */
void void
init_exception_processing () init_exception_processing (void)
{ {
tree tmp; tree tmp;
...@@ -90,7 +90,7 @@ init_exception_processing () ...@@ -90,7 +90,7 @@ init_exception_processing ()
propagated out of a cleanup region. */ propagated out of a cleanup region. */
static tree static tree
cp_protect_cleanup_actions () cp_protect_cleanup_actions (void)
{ {
/* [except.terminate] /* [except.terminate]
...@@ -100,8 +100,7 @@ cp_protect_cleanup_actions () ...@@ -100,8 +100,7 @@ cp_protect_cleanup_actions ()
} }
static tree static tree
prepare_eh_type (type) prepare_eh_type (tree type)
tree type;
{ {
if (type == NULL_TREE) if (type == NULL_TREE)
return type; return type;
...@@ -122,8 +121,7 @@ prepare_eh_type (type) ...@@ -122,8 +121,7 @@ prepare_eh_type (type)
matching field of the exception model. */ matching field of the exception model. */
static tree static tree
build_eh_type_type (type) build_eh_type_type (tree type)
tree type;
{ {
tree exp; tree exp;
...@@ -142,7 +140,7 @@ build_eh_type_type (type) ...@@ -142,7 +140,7 @@ build_eh_type_type (type)
} }
tree tree
build_exc_ptr () build_exc_ptr (void)
{ {
return build (EXC_PTR_EXPR, ptr_type_node); return build (EXC_PTR_EXPR, ptr_type_node);
} }
...@@ -151,7 +149,7 @@ build_exc_ptr () ...@@ -151,7 +149,7 @@ build_exc_ptr ()
exception has been handled. */ exception has been handled. */
static tree static tree
do_begin_catch () do_begin_catch (void)
{ {
tree fn; tree fn;
...@@ -173,8 +171,7 @@ do_begin_catch () ...@@ -173,8 +171,7 @@ do_begin_catch ()
NULL_TREE for a ... handler) will not throw an exception. */ NULL_TREE for a ... handler) will not throw an exception. */
static int static int
dtor_nothrow (type) dtor_nothrow (tree type)
tree type;
{ {
if (type == NULL_TREE) if (type == NULL_TREE)
return 0; return 0;
...@@ -189,8 +186,7 @@ dtor_nothrow (type) ...@@ -189,8 +186,7 @@ dtor_nothrow (type)
for the current catch block if no others are currently using it. */ for the current catch block if no others are currently using it. */
static tree static tree
do_end_catch (type) do_end_catch (tree type)
tree type;
{ {
tree fn, cleanup; tree fn, cleanup;
...@@ -214,8 +210,7 @@ do_end_catch (type) ...@@ -214,8 +210,7 @@ do_end_catch (type)
/* This routine creates the cleanup for the current exception. */ /* This routine creates the cleanup for the current exception. */
static void static void
push_eh_cleanup (type) push_eh_cleanup (tree type)
tree type;
{ {
finish_decl_cleanup (NULL_TREE, do_end_catch (type)); finish_decl_cleanup (NULL_TREE, do_end_catch (type));
} }
...@@ -224,9 +219,7 @@ push_eh_cleanup (type) ...@@ -224,9 +219,7 @@ push_eh_cleanup (type)
throw. */ throw. */
static bool static bool
decl_is_java_type (decl, err) decl_is_java_type (tree decl, int err)
tree decl;
int err;
{ {
bool r = (TREE_CODE (decl) == POINTER_TYPE bool r = (TREE_CODE (decl) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE && TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
...@@ -273,8 +266,7 @@ decl_is_java_type (decl, err) ...@@ -273,8 +266,7 @@ decl_is_java_type (decl, err)
__gxx_personality_(sj|v)0 in init_exception_processing - should it __gxx_personality_(sj|v)0 in init_exception_processing - should it
be done here instead? */ be done here instead? */
void void
choose_personality_routine (lang) choose_personality_routine (enum languages lang)
enum languages lang;
{ {
static enum { static enum {
chose_none, chose_none,
...@@ -328,9 +320,7 @@ choose_personality_routine (lang) ...@@ -328,9 +320,7 @@ choose_personality_routine (lang)
/* Initialize the catch parameter DECL. */ /* Initialize the catch parameter DECL. */
static void static void
initialize_handler_parm (decl, exp) initialize_handler_parm (tree decl, tree exp)
tree decl;
tree exp;
{ {
tree init; tree init;
tree init_type; tree init_type;
...@@ -383,8 +373,7 @@ initialize_handler_parm (decl, exp) ...@@ -383,8 +373,7 @@ initialize_handler_parm (decl, exp)
/* Call this to start a catch block. DECL is the catch parameter. */ /* Call this to start a catch block. DECL is the catch parameter. */
tree tree
expand_start_catch_block (decl) expand_start_catch_block (tree decl)
tree decl;
{ {
tree exp = NULL_TREE; tree exp = NULL_TREE;
tree type; tree type;
...@@ -451,7 +440,7 @@ expand_start_catch_block (decl) ...@@ -451,7 +440,7 @@ expand_start_catch_block (decl)
the label to jump to if this catch block didn't match. */ the label to jump to if this catch block didn't match. */
void void
expand_end_catch_block () expand_end_catch_block (void)
{ {
if (! doing_eh (1)) if (! doing_eh (1))
return; return;
...@@ -465,7 +454,7 @@ expand_end_catch_block () ...@@ -465,7 +454,7 @@ expand_end_catch_block ()
} }
tree tree
begin_eh_spec_block () begin_eh_spec_block (void)
{ {
tree r = build_stmt (EH_SPEC_BLOCK, NULL_TREE, NULL_TREE); tree r = build_stmt (EH_SPEC_BLOCK, NULL_TREE, NULL_TREE);
add_stmt (r); add_stmt (r);
...@@ -473,9 +462,7 @@ begin_eh_spec_block () ...@@ -473,9 +462,7 @@ begin_eh_spec_block ()
} }
void void
finish_eh_spec_block (raw_raises, eh_spec_block) finish_eh_spec_block (tree raw_raises, tree eh_spec_block)
tree raw_raises;
tree eh_spec_block;
{ {
tree raises; tree raises;
...@@ -494,8 +481,7 @@ finish_eh_spec_block (raw_raises, eh_spec_block) ...@@ -494,8 +481,7 @@ finish_eh_spec_block (raw_raises, eh_spec_block)
/* Return a pointer to a buffer for an exception object of type TYPE. */ /* Return a pointer to a buffer for an exception object of type TYPE. */
static tree static tree
do_allocate_exception (type) do_allocate_exception (tree type)
tree type;
{ {
tree fn; tree fn;
...@@ -518,8 +504,7 @@ do_allocate_exception (type) ...@@ -518,8 +504,7 @@ do_allocate_exception (type)
directly, but see the comment for stabilize_throw_expr. */ directly, but see the comment for stabilize_throw_expr. */
static tree static tree
do_free_exception (ptr) do_free_exception (tree ptr)
tree ptr;
{ {
tree fn; tree fn;
...@@ -541,10 +526,8 @@ do_free_exception (ptr) ...@@ -541,10 +526,8 @@ do_free_exception (ptr)
Called from build_throw via walk_tree_without_duplicates. */ Called from build_throw via walk_tree_without_duplicates. */
static tree static tree
wrap_cleanups_r (tp, walk_subtrees, data) wrap_cleanups_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
tree *tp; void *data ATTRIBUTE_UNUSED)
int *walk_subtrees ATTRIBUTE_UNUSED;
void *data ATTRIBUTE_UNUSED;
{ {
tree exp = *tp; tree exp = *tp;
tree cleanup; tree cleanup;
...@@ -583,9 +566,7 @@ wrap_cleanups_r (tp, walk_subtrees, data) ...@@ -583,9 +566,7 @@ wrap_cleanups_r (tp, walk_subtrees, data)
rather than in a MUST_NOT_THROW_EXPR, for this case only. */ rather than in a MUST_NOT_THROW_EXPR, for this case only. */
static tree static tree
stabilize_throw_expr (exp, initp) stabilize_throw_expr (tree exp, tree *initp)
tree exp;
tree *initp;
{ {
tree init_expr; tree init_expr;
...@@ -626,8 +607,7 @@ stabilize_throw_expr (exp, initp) ...@@ -626,8 +607,7 @@ stabilize_throw_expr (exp, initp)
/* Build a throw expression. */ /* Build a throw expression. */
tree tree
build_throw (exp) build_throw (tree exp)
tree exp;
{ {
tree fn; tree fn;
...@@ -805,9 +785,7 @@ build_throw (exp) ...@@ -805,9 +785,7 @@ build_throw (exp)
the expr or decl from whence TYPE came, if available. */ the expr or decl from whence TYPE came, if available. */
static int static int
complete_ptr_ref_or_void_ptr_p (type, from) complete_ptr_ref_or_void_ptr_p (tree type, tree from)
tree type;
tree from;
{ {
int is_ptr; int is_ptr;
...@@ -835,8 +813,7 @@ complete_ptr_ref_or_void_ptr_p (type, from) ...@@ -835,8 +813,7 @@ complete_ptr_ref_or_void_ptr_p (type, from)
a type or of an abstract class type. */ a type or of an abstract class type. */
static bool static bool
is_admissible_throw_operand (expr) is_admissible_throw_operand (tree expr)
tree expr;
{ {
tree type = TREE_TYPE (expr); tree type = TREE_TYPE (expr);
...@@ -873,8 +850,7 @@ is_admissible_throw_operand (expr) ...@@ -873,8 +850,7 @@ is_admissible_throw_operand (expr)
#include "cfns.h" #include "cfns.h"
int int
nothrow_libfn_p (fn) nothrow_libfn_p (tree fn)
tree fn;
{ {
tree id; tree id;
...@@ -895,8 +871,7 @@ nothrow_libfn_p (fn) ...@@ -895,8 +871,7 @@ nothrow_libfn_p (fn)
handler for type TO, as per [except.handle]. */ handler for type TO, as per [except.handle]. */
static int static int
can_convert_eh (to, from) can_convert_eh (tree to, tree from)
tree to, from;
{ {
if (TREE_CODE (to) == REFERENCE_TYPE) if (TREE_CODE (to) == REFERENCE_TYPE)
to = TREE_TYPE (to); to = TREE_TYPE (to);
...@@ -931,9 +906,7 @@ can_convert_eh (to, from) ...@@ -931,9 +906,7 @@ can_convert_eh (to, from)
for B would catch an exception of type C. */ for B would catch an exception of type C. */
static void static void
check_handlers_1 (master, handlers) check_handlers_1 (tree master, tree handlers)
tree master;
tree handlers;
{ {
tree type = TREE_TYPE (master); tree type = TREE_TYPE (master);
tree handler; tree handler;
...@@ -954,8 +927,7 @@ check_handlers_1 (master, handlers) ...@@ -954,8 +927,7 @@ check_handlers_1 (master, handlers)
/* Given a chain of HANDLERs, make sure that they're OK. */ /* Given a chain of HANDLERs, make sure that they're OK. */
void void
check_handlers (handlers) check_handlers (tree handlers)
tree handlers;
{ {
tree handler; tree handler;
int save_line = lineno; int save_line = lineno;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment