From: Mark Mitchell Date: Wed, 11 Feb 1998 22:47:30 +0000 (+0000) Subject: tree.c (is_overloaded_fn): Use really_overloaded_fn. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=06ab59dfa0a756ffa178714e54c91835aa484f0c;p=gcc.git tree.c (is_overloaded_fn): Use really_overloaded_fn. * tree.c (is_overloaded_fn): Use really_overloaded_fn. (really_overloaded_fn): Move check here from is_overloaded_fn. (get_first_fn): Use really_overloaded_fn and is_overloaded_fn. From-SVN: r17863 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e944c6e68fa..8534f1ae0c5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +Wed Feb 11 16:42:04 1998 Mark Mitchell + + * tree.c (is_overloaded_fn): Use really_overloaded_fn. + (really_overloaded_fn): Move check here from is_overloaded_fn. + (get_first_fn): Use really_overloaded_fn and is_overloaded_fn. + Mon Feb 9 22:23:31 1998 Mark Mitchell * cp-tree.h (push_template_decl): Return the decl passed in, or an diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 6ad57402be4..1bd60f177b5 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1299,39 +1299,31 @@ int is_overloaded_fn (x) tree x; { - if (TREE_CODE (x) == FUNCTION_DECL - || TREE_CODE (x) == TEMPLATE_ID_EXPR - || DECL_FUNCTION_TEMPLATE_P (x)) - return 1; - - if (TREE_CODE (x) == TREE_LIST - && (TREE_CODE (TREE_VALUE (x)) == FUNCTION_DECL - || DECL_FUNCTION_TEMPLATE_P (TREE_VALUE (x)))) - return 1; - - return 0; + return (TREE_CODE (x) == FUNCTION_DECL + || TREE_CODE (x) == TEMPLATE_ID_EXPR + || DECL_FUNCTION_TEMPLATE_P (x) + || really_overloaded_fn (x)); } int really_overloaded_fn (x) tree x; { - return TREE_CODE (x) != FUNCTION_DECL - && is_overloaded_fn (x); + return (TREE_CODE (x) == TREE_LIST + && (TREE_CODE (TREE_VALUE (x)) == FUNCTION_DECL + || DECL_FUNCTION_TEMPLATE_P (TREE_VALUE (x)))); } tree get_first_fn (from) tree from; { - if (TREE_CODE (from) == FUNCTION_DECL - || TREE_CODE (from) == TEMPLATE_ID_EXPR - || DECL_FUNCTION_TEMPLATE_P (from)) - return from; + my_friendly_assert (is_overloaded_fn (from), 9); - my_friendly_assert (TREE_CODE (from) == TREE_LIST, 9); - - return TREE_VALUE (from); + if (really_overloaded_fn (from)) + return TREE_VALUE (from); + else + return from; } int