This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: (C++) patch to reorganize internal FUNCTION_DECL generation
- To: gcc-patches at gcc dot gnu dot org
- Subject: Re: (C++) patch to reorganize internal FUNCTION_DECL generation
- From: Jason Merrill <jason at cygnus dot com>
- Date: 10 Mar 2000 16:22:41 -0800
- References: <200003100923.BAA25597@casey.cygnus.com>
Oops; some of the functions using push_throw_library_fn take void, and some
return void.
2000-03-10 Jason Merrill <jason@casey.cygnus.com>
* decl.c (push_throw_library_fn): Take the FUNCTION_TYPE.
* except.c (expand_end_eh_spec): Add the return type.
* rtti.c (throw_bad_cast): Add the parmtypes.
(throw_bad_typeid): Likewise.
Index: decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.563
diff -c -p -r1.563 decl.c
*** decl.c 2000/03/10 11:56:00 1.563
--- decl.c 2000/03/11 00:08:42
*************** push_void_library_fn (name, parmtypes)
*** 6578,6591 ****
return push_library_fn (name, type);
}
! /* Like push_void_library_fn, but also note that this function throws
and does not return. Used for __throw_foo and the like. */
tree
! push_throw_library_fn (name, parmtypes)
! tree name, parmtypes;
{
! tree fn = push_void_library_fn (name, parmtypes);
TREE_THIS_VOLATILE (fn) = 1;
TREE_NOTHROW (fn) = 0;
return fn;
--- 6575,6588 ----
return push_library_fn (name, type);
}
! /* Like push_library_fn, but also note that this function throws
and does not return. Used for __throw_foo and the like. */
tree
! push_throw_library_fn (name, type)
! tree name, type;
{
! tree fn = push_library_fn (name, type);
TREE_THIS_VOLATILE (fn) = 1;
TREE_NOTHROW (fn) = 0;
return fn;
Index: except.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/except.c,v
retrieving revision 1.101
diff -c -p -r1.101 except.c
*** except.c 2000/03/10 11:56:00 1.101
--- except.c 2000/03/11 00:08:42
*************** expand_end_eh_spec (raises, try_block)
*** 719,724 ****
--- 719,725 ----
tmp = tree_cons
(NULL_TREE, integer_type_node, tree_cons
(NULL_TREE, TREE_TYPE (decl), void_list_node));
+ tmp = build_function_type (void_type_node, tmp);
fn = push_throw_library_fn (fn, tmp);
}
Index: rtti.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/rtti.c,v
retrieving revision 1.65
diff -c -p -r1.65 rtti.c
*** rtti.c 2000/03/10 09:25:45 1.65
--- rtti.c 2000/03/11 00:08:44
*************** throw_bad_cast ()
*** 175,181 ****
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
! fn = push_throw_library_fn (fn, ptr_type_node);
return build_call (fn, NULL_TREE);
}
--- 175,182 ----
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
! fn = push_throw_library_fn (fn, build_function_type (ptr_type_node,
! void_list_node));
return build_call (fn, NULL_TREE);
}
*************** throw_bad_typeid ()
*** 187,195 ****
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
! fn = push_throw_library_fn (fn, build_reference_type
! (build_qualified_type
! (type_info_type_node, TYPE_QUAL_CONST)));
return build_call (fn, NULL_TREE);
}
--- 188,198 ----
if (IDENTIFIER_GLOBAL_VALUE (fn))
fn = IDENTIFIER_GLOBAL_VALUE (fn);
else
! {
! tree t = build_qualified_type (type_info_type_node, TYPE_QUAL_CONST);
! t = build_function_type (build_reference_type (t), void_list_node);
! fn = push_throw_library_fn (fn, t);
! }
return build_call (fn, NULL_TREE);
}