aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/rtti.c
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@integrable-solutions.net>2003-09-27 16:44:05 +0000
committerGabriel Dos Reis <gdr@gcc.gnu.org>2003-09-27 16:44:05 +0000
commitc003e212ead438407d7968c2ada135f90307a8be (patch)
treed165f5d3ea36c74d1560aeb2b2e40406468c4db1 /gcc/cp/rtti.c
parent6398fbfddca9e92f601fa68764b2efccd3a30124 (diff)
downloadgcc-c003e212ead438407d7968c2ada135f90307a8be.zip
gcc-c003e212ead438407d7968c2ada135f90307a8be.tar.gz
gcc-c003e212ead438407d7968c2ada135f90307a8be.tar.bz2
name-lookup.h (get_global_value_if_present): New function.
* name-lookup.h (get_global_value_if_present): New function. (is_typename_at_global_scope): Likewise. * except.c (do_begin_catch): Use get_global_value_if_present. (do_end_catch): Likewise. (do_allocate_exception): Likewise. (do_free_exception): Likewise. (build_throw): Likewise. * parser.c (cp_parser_member_declaration): Likewise. * rtti.c (throw_bad_cast): Likewise. (throw_bad_typeid): Likewise. * decl.c (check_tag_decl): Use is_typename_at_global_scope. (grokdeclarator): Likewise. * cp-tree.h (global_namespace): Move to name-lookup.h * call.c (call_builtin_trap): Tidy. From-SVN: r71858
Diffstat (limited to 'gcc/cp/rtti.c')
-rw-r--r--gcc/cp/rtti.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index c53238f..391a581 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -172,9 +172,7 @@ static tree
throw_bad_cast (void)
{
tree fn = get_identifier ("__cxa_bad_cast");
- if (IDENTIFIER_GLOBAL_VALUE (fn))
- fn = IDENTIFIER_GLOBAL_VALUE (fn);
- else
+ if (!get_global_value_if_present (fn, &fn))
fn = push_throw_library_fn (fn, build_function_type (ptr_type_node,
void_list_node));
@@ -188,9 +186,7 @@ static tree
throw_bad_typeid (void)
{
tree fn = get_identifier ("__cxa_bad_typeid");
- if (IDENTIFIER_GLOBAL_VALUE (fn))
- fn = IDENTIFIER_GLOBAL_VALUE (fn);
- else
+ if (!get_global_value_if_present (fn, &fn))
{
tree t = build_qualified_type (type_info_type_node, TYPE_QUAL_CONST);
t = build_function_type (build_reference_type (t), void_list_node);