This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[mainline] C++ PATCH: Use C90 prototypes in cp/except.c


Bootstrapped and regtested.

-- Gaby
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/ChangeLog,v
retrieving revision 1.3244
diff -p -r1.3244 ChangeLog
*** ChangeLog	7 Mar 2003 07:03:17 -0000	1.3244
--- ChangeLog	7 Mar 2003 07:43:48 -0000
***************
*** 1,3 ****
--- 1,33 ----
+ 2003-03-07  Gabriel Dos Reis  <gdr at integrable-solutions dot 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 at codesourcery dot com>
  
  	* call.c (merge_conversion_sequences): New function.
Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/except.c,v
retrieving revision 1.153
diff -p -r1.153 except.c
*** except.c	3 Jan 2003 20:04:37 -0000	1.153
--- except.c	7 Mar 2003 07:43:48 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 38,66 ****
  #include "toplev.h"
  #include "tree-inline.h"
  
! static void push_eh_cleanup PARAMS ((tree));
! static tree prepare_eh_type PARAMS ((tree));
! static tree build_eh_type_type PARAMS ((tree));
! static tree do_begin_catch PARAMS ((void));
! static int dtor_nothrow PARAMS ((tree));
! static tree do_end_catch PARAMS ((tree));
! static void push_eh_cleanup PARAMS ((tree));
! static bool decl_is_java_type PARAMS ((tree decl, int err));
! static void initialize_handler_parm PARAMS ((tree, tree));
! static tree do_allocate_exception PARAMS ((tree));
! static tree stabilize_throw_expr PARAMS ((tree, tree *));
! static tree wrap_cleanups_r PARAMS ((tree *, int *, void *));
! static int complete_ptr_ref_or_void_ptr_p PARAMS ((tree, tree));
! static bool is_admissible_throw_operand PARAMS ((tree));
! static int can_convert_eh PARAMS ((tree, tree));
! static void check_handlers_1 PARAMS ((tree, tree));
! static tree cp_protect_cleanup_actions PARAMS ((void));
  
  /* Sets up all the global eh stuff that needs to be initialized at the
     start of compilation.  */
  
  void
! init_exception_processing ()
  {
    tree tmp;
  
--- 38,66 ----
  #include "toplev.h"
  #include "tree-inline.h"
  
! static void push_eh_cleanup (tree);
! static tree prepare_eh_type (tree);
! static tree build_eh_type_type (tree);
! static tree do_begin_catch (void);
! static int dtor_nothrow (tree);
! static tree do_end_catch (tree);
! static void push_eh_cleanup (tree);
! static bool decl_is_java_type (tree decl, int err);
! static void initialize_handler_parm (tree, tree);
! static tree do_allocate_exception (tree);
! static tree stabilize_throw_expr (tree, tree *);
! static tree wrap_cleanups_r (tree *, int *, void *);
! static int complete_ptr_ref_or_void_ptr_p (tree, tree);
! static bool is_admissible_throw_operand (tree);
! static int can_convert_eh (tree, tree);
! static void check_handlers_1 (tree, tree);
! static tree cp_protect_cleanup_actions (void);
  
  /* Sets up all the global eh stuff that needs to be initialized at the
     start of compilation.  */
  
  void
! init_exception_processing (void)
  {
    tree tmp;
  
*************** init_exception_processing ()
*** 90,96 ****
     propagated out of a cleanup region.  */
  
  static tree
! cp_protect_cleanup_actions ()
  {
    /* [except.terminate]
  
--- 90,96 ----
     propagated out of a cleanup region.  */
  
  static tree
! cp_protect_cleanup_actions (void)
  {
    /* [except.terminate]
  
*************** cp_protect_cleanup_actions ()
*** 100,107 ****
  }     
  
  static tree
! prepare_eh_type (type)
!      tree type;
  {
    if (type == NULL_TREE)
      return type;
--- 100,106 ----
  }     
  
  static tree
! prepare_eh_type (tree type)
  {
    if (type == NULL_TREE)
      return type;
*************** prepare_eh_type (type)
*** 122,129 ****
     matching field of the exception model.  */
  
  static tree
! build_eh_type_type (type)
!      tree type;
  {
    tree exp;
  
--- 121,127 ----
     matching field of the exception model.  */
  
  static tree
! build_eh_type_type (tree type)
  {
    tree exp;
  
*************** build_eh_type_type (type)
*** 142,148 ****
  }
  
  tree
! build_exc_ptr ()
  {
    return build (EXC_PTR_EXPR, ptr_type_node);
  }
--- 140,146 ----
  }
  
  tree
! build_exc_ptr (void)
  {
    return build (EXC_PTR_EXPR, ptr_type_node);
  }
*************** build_exc_ptr ()
*** 151,157 ****
     exception has been handled.  */
  
  static tree
! do_begin_catch ()
  {
    tree fn;
  
--- 149,155 ----
     exception has been handled.  */
  
  static tree
! do_begin_catch (void)
  {
    tree fn;
  
*************** do_begin_catch ()
*** 173,180 ****
     NULL_TREE for a ... handler) will not throw an exception.  */
  
  static int
! dtor_nothrow (type)
!      tree type;
  {
    if (type == NULL_TREE)
      return 0;
--- 171,177 ----
     NULL_TREE for a ... handler) will not throw an exception.  */
  
  static int
! dtor_nothrow (tree type)
  {
    if (type == NULL_TREE)
      return 0;
*************** dtor_nothrow (type)
*** 189,196 ****
     for the current catch block if no others are currently using it.  */
  
  static tree
! do_end_catch (type)
!      tree type;
  {
    tree fn, cleanup;
  
--- 186,192 ----
     for the current catch block if no others are currently using it.  */
  
  static tree
! do_end_catch (tree type)
  {
    tree fn, cleanup;
  
*************** do_end_catch (type)
*** 214,221 ****
  /* This routine creates the cleanup for the current exception.  */
  
  static void
! push_eh_cleanup (type)
!      tree type;
  {
    finish_decl_cleanup (NULL_TREE, do_end_catch (type));
  }
--- 210,216 ----
  /* This routine creates the cleanup for the current exception.  */
  
  static void
! push_eh_cleanup (tree type)
  {
    finish_decl_cleanup (NULL_TREE, do_end_catch (type));
  }
*************** push_eh_cleanup (type)
*** 224,232 ****
     throw.  */
  
  static bool
! decl_is_java_type (decl, err)
!      tree decl;
!      int err;
  {
    bool r = (TREE_CODE (decl) == POINTER_TYPE
  	    && TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
--- 219,225 ----
     throw.  */
  
  static bool
! decl_is_java_type (tree decl, int err)
  {
    bool r = (TREE_CODE (decl) == POINTER_TYPE
  	    && TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
*************** decl_is_java_type (decl, err)
*** 273,280 ****
     __gxx_personality_(sj|v)0 in init_exception_processing - should it
     be done here instead?  */
  void
! choose_personality_routine (lang)
!      enum languages lang;
  {
    static enum {
      chose_none,
--- 266,272 ----
     __gxx_personality_(sj|v)0 in init_exception_processing - should it
     be done here instead?  */
  void
! choose_personality_routine (enum languages lang)
  {
    static enum {
      chose_none,
*************** choose_personality_routine (lang)
*** 328,336 ****
  /* Initialize the catch parameter DECL.  */
  
  static void 
! initialize_handler_parm (decl, exp)
!      tree decl;
!      tree exp;
  {
    tree init;
    tree init_type;
--- 320,326 ----
  /* Initialize the catch parameter DECL.  */
  
  static void 
! initialize_handler_parm (tree decl, tree exp)
  {
    tree init;
    tree init_type;
*************** initialize_handler_parm (decl, exp)
*** 383,390 ****
  /* Call this to start a catch block.  DECL is the catch parameter.  */
  
  tree
! expand_start_catch_block (decl)
!      tree decl;
  {
    tree exp = NULL_TREE;
    tree type;
--- 373,379 ----
  /* Call this to start a catch block.  DECL is the catch parameter.  */
  
  tree
! expand_start_catch_block (tree decl)
  {
    tree exp = NULL_TREE;
    tree type;
*************** expand_start_catch_block (decl)
*** 451,457 ****
     the label to jump to if this catch block didn't match.  */
  
  void
! expand_end_catch_block ()
  {
    if (! doing_eh (1))
      return;
--- 440,446 ----
     the label to jump to if this catch block didn't match.  */
  
  void
! expand_end_catch_block (void)
  {
    if (! doing_eh (1))
      return;
*************** expand_end_catch_block ()
*** 465,471 ****
  }
  
  tree
! begin_eh_spec_block ()
  {
    tree r = build_stmt (EH_SPEC_BLOCK, NULL_TREE, NULL_TREE);
    add_stmt (r);
--- 454,460 ----
  }
  
  tree
! begin_eh_spec_block (void)
  {
    tree r = build_stmt (EH_SPEC_BLOCK, NULL_TREE, NULL_TREE);
    add_stmt (r);
*************** begin_eh_spec_block ()
*** 473,481 ****
  }
  
  void
! finish_eh_spec_block (raw_raises, eh_spec_block)
!      tree raw_raises;
!      tree eh_spec_block;
  {
    tree raises;
  
--- 462,468 ----
  }
  
  void
! finish_eh_spec_block (tree raw_raises, tree eh_spec_block)
  {
    tree raises;
  
*************** finish_eh_spec_block (raw_raises, eh_spe
*** 494,501 ****
  /* Return a pointer to a buffer for an exception object of type TYPE.  */
  
  static tree
! do_allocate_exception (type)
!      tree type;
  {
    tree fn;
  
--- 481,487 ----
  /* Return a pointer to a buffer for an exception object of type TYPE.  */
  
  static tree
! do_allocate_exception (tree type)
  {
    tree fn;
  
*************** do_allocate_exception (type)
*** 518,525 ****
     directly, but see the comment for stabilize_throw_expr.  */
  
  static tree
! do_free_exception (ptr)
!      tree ptr;
  {
    tree fn;
  
--- 504,510 ----
     directly, but see the comment for stabilize_throw_expr.  */
  
  static tree
! do_free_exception (tree ptr)
  {
    tree fn;
  
*************** do_free_exception (ptr)
*** 541,550 ****
     Called from build_throw via walk_tree_without_duplicates.  */
  
  static tree
! wrap_cleanups_r (tp, walk_subtrees, data)
!      tree *tp;
!      int *walk_subtrees ATTRIBUTE_UNUSED;
!      void *data ATTRIBUTE_UNUSED;
  {
    tree exp = *tp;
    tree cleanup;
--- 526,533 ----
     Called from build_throw via walk_tree_without_duplicates.  */
  
  static tree
! wrap_cleanups_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
!                  void *data ATTRIBUTE_UNUSED)
  {
    tree exp = *tp;
    tree cleanup;
*************** wrap_cleanups_r (tp, walk_subtrees, data
*** 583,591 ****
     rather than in a MUST_NOT_THROW_EXPR, for this case only.  */
  
  static tree
! stabilize_throw_expr (exp, initp)
!      tree exp;
!      tree *initp;
  {
    tree init_expr;
  
--- 566,572 ----
     rather than in a MUST_NOT_THROW_EXPR, for this case only.  */
  
  static tree
! stabilize_throw_expr (tree exp, tree *initp)
  {
    tree init_expr;
  
*************** stabilize_throw_expr (exp, initp)
*** 626,633 ****
  /* Build a throw expression.  */
  
  tree
! build_throw (exp)
!      tree exp;
  {
    tree fn;
  
--- 607,613 ----
  /* Build a throw expression.  */
  
  tree
! build_throw (tree exp)
  {
    tree fn;
  
*************** build_throw (exp)
*** 805,813 ****
     the expr or decl from whence TYPE came, if available.  */
  
  static int
! complete_ptr_ref_or_void_ptr_p (type, from)
!      tree type;
!      tree from;
  {
    int is_ptr;
    
--- 785,791 ----
     the expr or decl from whence TYPE came, if available.  */
  
  static int
! complete_ptr_ref_or_void_ptr_p (tree type, tree from)
  {
    int is_ptr;
    
*************** complete_ptr_ref_or_void_ptr_p (type, fr
*** 835,842 ****
     a type or of an abstract class type.  */
  
  static bool
! is_admissible_throw_operand (expr)
!      tree expr;
  {
    tree type = TREE_TYPE (expr);
  
--- 813,819 ----
     a type or of an abstract class type.  */
  
  static bool
! is_admissible_throw_operand (tree expr)
  {
    tree type = TREE_TYPE (expr);
  
*************** is_admissible_throw_operand (expr)
*** 873,880 ****
  #include "cfns.h"
  
  int
! nothrow_libfn_p (fn)
!      tree fn;
  {
    tree id;
  
--- 850,856 ----
  #include "cfns.h"
  
  int
! nothrow_libfn_p (tree fn)
  {
    tree id;
  
*************** nothrow_libfn_p (fn)
*** 895,902 ****
     handler for type TO, as per [except.handle].  */
  
  static int
! can_convert_eh (to, from)
!      tree to, from;
  {
    if (TREE_CODE (to) == REFERENCE_TYPE)
      to = TREE_TYPE (to);
--- 871,877 ----
     handler for type TO, as per [except.handle].  */
  
  static int
! can_convert_eh (tree to, tree from)
  {
    if (TREE_CODE (to) == REFERENCE_TYPE)
      to = TREE_TYPE (to);
*************** can_convert_eh (to, from)
*** 931,939 ****
     for B would catch an exception of type C.  */
  
  static void
! check_handlers_1 (master, handlers)
!      tree master;
!      tree handlers;
  {
    tree type = TREE_TYPE (master);
    tree handler;
--- 906,912 ----
     for B would catch an exception of type C.  */
  
  static void
! check_handlers_1 (tree master, tree handlers)
  {
    tree type = TREE_TYPE (master);
    tree handler;
*************** check_handlers_1 (master, handlers)
*** 954,961 ****
  /* Given a chain of HANDLERs, make sure that they're OK.  */
  
  void
! check_handlers (handlers)
!      tree handlers;
  {
    tree handler;
    int save_line = lineno;
--- 927,933 ----
  /* Given a chain of HANDLERs, make sure that they're OK.  */
  
  void
! check_handlers (tree handlers)
  {
    tree handler;
    int save_line = lineno;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]