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]

Minor C++ PATCH to except.c


Browsing except.c the other day, I noticed a couple of things that could be
documented more clearly.

2000-12-04  Jason Merrill  <jason@redhat.com>

	* except.c (expand_throw): Use push_throw_library_fn for _Jv_Throw.

*** except.c.~1~	Mon Dec  4 16:26:59 2000
--- except.c	Mon Dec  4 16:27:20 2000
*************** expand_end_eh_spec (raises, try_block)
*** 692,699 ****
  	{
  	  tmp = build_function_type (void_type_node, void_list_node);
  	  fn = push_throw_library_fn (fn, tmp);
! 	  /* Since the spec doesn't allow any exceptions, this call
! 	     will never throw.  */
  	  TREE_NOTHROW (fn) = 1;
  	}
        tmp = NULL_TREE;
--- 692,700 ----
  	{
  	  tmp = build_function_type (void_type_node, void_list_node);
  	  fn = push_throw_library_fn (fn, tmp);
! 	  /* Since the spec doesn't allow any exceptions, this call will
! 	     never throw.  We use push_throw_library_fn because we do want
! 	     TREE_THIS_VOLATILE to be set.  */
  	  TREE_NOTHROW (fn) = 1;
  	}
        tmp = NULL_TREE;
*************** expand_throw (exp)
*** 837,845 ****
  	     exception.cc.  */
  	  tree tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
  	  tmp = build_function_type (ptr_type_node, tmp);
! 	  fn = push_library_fn (fn, tmp);
! 	  TREE_THIS_VOLATILE (fn) = 1;
! 	  TREE_NOTHROW (fn) = 0;
  	}
  
        exp = build_function_call (fn, args);
--- 838,844 ----
  	     exception.cc.  */
  	  tree tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
  	  tmp = build_function_type (ptr_type_node, tmp);
! 	  fn = push_throw_library_fn (fn, tmp);
  	}
  
        exp = build_function_call (fn, args);
*************** expand_throw (exp)
*** 886,902 ****
  	     user function that exits via an uncaught exception.
  
  	     So we have to protect the actual initialization of the
! 	     exception object with terminate(), but evaluate the expression
! 	     first.  We also expand the call to __eh_alloc
! 	     first.  Since there could be temps in the expression, we need
! 	     to handle that, too.  */
  
  	  my_friendly_assert (stmts_are_full_exprs_p () == 1, 19990926);
  
  	  /* Store the throw expression into a temp.  This can be less
  	     efficient than storing it into the allocated space directly, but
! 	     oh well.  To do this efficiently we would need to insinuate
! 	     ourselves into expand_call.  */
  	  if (TREE_SIDE_EFFECTS (exp))
  	    {
  	      tree temp = create_temporary_var (TREE_TYPE (exp));
--- 885,902 ----
  	     user function that exits via an uncaught exception.
  
  	     So we have to protect the actual initialization of the
! 	     exception object with terminate(), but evaluate the
! 	     expression first.  Since there could be temps in the
! 	     expression, we need to handle that, too.  We also expand
! 	     the call to __eh_alloc first (which doesn't matter, since
! 	     it can't throw).  */
  
  	  my_friendly_assert (stmts_are_full_exprs_p () == 1, 19990926);
  
  	  /* Store the throw expression into a temp.  This can be less
  	     efficient than storing it into the allocated space directly, but
! 	     if we allocated the space first we would have to deal with
! 	     cleaning it up if evaluating this expression throws.  */
  	  if (TREE_SIDE_EFFECTS (exp))
  	    {
  	      tree temp = create_temporary_var (TREE_TYPE (exp));

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