Commit 1ef9f749 by Jason Merrill Committed by Jason Merrill

exception.cc (__check_null_eh_spec): New fn.

        * exception.cc (__check_null_eh_spec): New fn.
        * except.c (expand_end_eh_spec): Call it if the spec is throw().

From-SVN: r32480
parent 8d2daaa7
2000-03-11 Jason Merrill <jason@casey.cygnus.com>
* exception.cc (__check_null_eh_spec): New fn.
* except.c (expand_end_eh_spec): Call it if the spec is throw().
2000-03-10 Jason Merrill <jason@casey.cygnus.com>
* decl.c (push_throw_library_fn): Take the FUNCTION_TYPE.
......
......@@ -690,6 +690,23 @@ expand_end_eh_spec (raises, try_block)
handler = begin_handler ();
blocks = finish_handler_parms (NULL_TREE, handler);
if (TREE_VALUE (raises) == NULL_TREE)
{
fn = get_identifier ("__check_null_eh_spec");
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
{
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;
}
else
{
/* Build up an array of type_infos. */
for (; raises && TREE_VALUE (raises); raises = TREE_CHAIN (raises))
{
......@@ -726,6 +743,8 @@ expand_end_eh_spec (raises, try_block)
tmp = tree_cons (NULL_TREE, build_int_2 (count, 0),
tree_cons (NULL_TREE, decl, NULL_TREE));
}
tmp = build_call (fn, tmp);
finish_expr_stmt (tmp);
......
// Functions for Exception Support for -*- C++ -*-
// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999 Free Software Foundation
// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation
// This file is part of GNU CC.
......@@ -321,6 +321,14 @@ __check_eh_spec (int n, const void **spec)
}
}
/* Special case of the above for throw() specs. */
extern "C" void
__check_null_eh_spec (void)
{
__check_eh_spec (0, 0);
}
// Helpers for rtti. Although these don't return, we give them return types so
// that the type system is not broken.
......
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