FreeBSD/contrib/gcc/cp/typeck.c
/* Return true if TYPE1 and TYPE2 are equivalent exception specifiers.
   If EXACT is false, T2 can be stricter than T1 (according to 15.4/7),
   otherwise it must be exact. Exception lists are unordered, but
   we've already filtered out duplicates. Most lists will be in order,
   we should try to make use of that.  */
Return true if TYPE1 and TYPE2 are equivalent exception specifiers.
If EXACT is false, T2 can be stricter than T1 (according to 15.4/7),
otherwise it must be exact. Exception lists are unordered, but
we've already filtered out duplicates. Most lists will be in order,
we should try to make use of that.
Return true if TYPE1 and TYPE2 are equivalent exception specifiers . If EXACT is false T2 can be stricter than T1 ( according to 15 . 4 / 7 ) otherwise it must be exact . Exception lists are unordered but we ' ve already filtered out duplicates . Most lists will be in order we should try to make use of that .
bool
comp_except_specs (tree t1, tree t2, bool exact)
{
  tree probe;
  tree base;
  int  length = 0;
  if (t1 == t2)
    return true;
  if (t1 == NULL_TREE)			   
    return t2 == NULL_TREE || !exact;
  if (!TREE_VALUE (t1))			   
    return t2 != NULL_TREE && !TREE_VALUE (t2);
  if (t2 == NULL_TREE)			   
    return false;
  if (TREE_VALUE (t1) && !TREE_VALUE (t2)) 
    return !exact;
  for (base = t1; t2 != NULL_TREE; t2 = TREE_CHAIN (t2))
    {
      for (probe = base; probe != NULL_TREE; probe = TREE_CHAIN (probe))
	{
	  tree a = TREE_VALUE (probe);
	  tree b = TREE_VALUE (t2);
	  if (comp_except_types (a, b, exact))
	    {
	      if (probe == base && exact)
		base = TREE_CHAIN (probe);
	      length++;
	      break;
	    }
	}
      if (probe == NULL_TREE)
	return false;
    }
  return !exact || base == NULL_TREE || length == list_length (t1);
}
bool comp_except_specs ( tree t1 , tree t2 , bool exact ) { tree probe ; tree base ; int length = 0 ; if ( t1 == t2 ) return true ; if ( t1 == NULL_TREE ) return t2 == NULL_TREE || ! exact ; if ( ! TREE_VALUE ( t1 ) ) return t2 != NULL_TREE && ! TREE_VALUE ( t2 ) ; if ( t2 == NULL_TREE ) return false ; if ( TREE_VALUE ( t1 ) && ! TREE_VALUE ( t2 ) ) return ! exact ; for ( base = t1 ; t2 != NULL_TREE ; t2 = TREE_CHAIN ( t2 ) ) { for ( probe = base ; probe != NULL_TREE ; probe = TREE_CHAIN ( probe ) ) { tree a = TREE_VALUE ( probe ) ; tree b = TREE_VALUE ( t2 ) ; if ( comp_except_types ( a , b , exact ) ) { if ( probe == base && exact ) base = TREE_CHAIN ( probe ) ; length ++ ; break ; } } if ( probe == NULL_TREE ) return false ; } return ! exact || base == NULL_TREE || length == list_length ( t1 ) ; }
Return true if TYPE1 and TYPE2 are equivalent exception specifiers.
Return true if TYPE1 and TYPE2 are equivalent exception specifiers .
/* T1 is ...  */ /* t1 is EMPTY */ /* T2 is ...  */ /* T2 is EMPTY, T1 is not */ /* Neither set is ... or EMPTY, make sure each part of T2 is in T1.
     Count how many we find, to determine exactness. For exact matching and
     ordered T1, T2, this is an O(n) operation, otherwise its worst case is
     O(nm).  */