FreeBSD/contrib/gcc/cp/method.c
/* Use EXTRACTOR to locate the relevant function called for each base &
   class field of TYPE. CLIENT allows additional information to be passed
   to EXTRACTOR.  Generates the union of all exceptions generated by those
   functions.  Note that we haven't updated TYPE_FIELDS and such of any
   variants yet, so we need to look at the main one.  */
Use EXTRACTOR to locate the relevant function called for each base &
class field of TYPE. CLIENT allows additional information to be passed
to EXTRACTOR.  Generates the union of all exceptions generated by those
functions.  Note that we haven't updated TYPE_FIELDS and such of any
variants yet, so we need to look at the main one.
Use EXTRACTOR to locate the relevant function called for each base & class field of TYPE . CLIENT allows additional information to be passed to EXTRACTOR . Generates the union of all exceptions generated by those functions . Note that we haven ' t updated TYPE_FIELDS and such of any variants yet so we need to look at the main one .
static tree
synthesize_exception_spec (tree type, tree (*extractor) (tree, void*),
			   void *client)
{
  tree raises = empty_except_spec;
  tree fields = TYPE_FIELDS (type);
  tree binfo, base_binfo;
  int i;
  for (binfo = TYPE_BINFO (type), i = 0;
       BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
    {
      tree fn = (*extractor) (BINFO_TYPE (base_binfo), client);
      if (fn)
	{
	  tree fn_raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn));
	  raises = merge_exception_specifiers (raises, fn_raises);
	}
    }
  for (; fields; fields = TREE_CHAIN (fields))
    {
      tree type = TREE_TYPE (fields);
      tree fn;
      if (TREE_CODE (fields) != FIELD_DECL || DECL_ARTIFICIAL (fields))
	continue;
      while (TREE_CODE (type) == ARRAY_TYPE)
	type = TREE_TYPE (type);
      if (!CLASS_TYPE_P (type))
	continue;
      fn = (*extractor) (type, client);
      if (fn)
	{
	  tree fn_raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn));
	  raises = merge_exception_specifiers (raises, fn_raises);
	}
    }
  return raises;
}
static tree synthesize_exception_spec ( tree type , tree ( * extractor ) ( tree , void * ) , void * client ) { tree raises = empty_except_spec ; tree fields = TYPE_FIELDS ( type ) ; tree binfo , base_binfo ; int i ; for ( binfo = TYPE_BINFO ( type ) , i = 0 ; BINFO_BASE_ITERATE ( binfo , i , base_binfo ) ; i ++ ) { tree fn = ( * extractor ) ( BINFO_TYPE ( base_binfo ) , client ) ; if ( fn ) { tree fn_raises = TYPE_RAISES_EXCEPTIONS ( TREE_TYPE ( fn ) ) ; raises = merge_exception_specifiers ( raises , fn_raises ) ; } } for ( ; fields ; fields = TREE_CHAIN ( fields ) ) { tree type = TREE_TYPE ( fields ) ; tree fn ; if ( TREE_CODE ( fields ) != FIELD_DECL || DECL_ARTIFICIAL ( fields ) ) continue ; while ( TREE_CODE ( type ) == ARRAY_TYPE ) type = TREE_TYPE ( type ) ; if ( ! CLASS_TYPE_P ( type ) ) continue ; fn = ( * extractor ) ( type , client ) ; if ( fn ) { tree fn_raises = TYPE_RAISES_EXCEPTIONS ( TREE_TYPE ( fn ) ) ; raises = merge_exception_specifiers ( raises , fn_raises ) ; } } return raises ; }
Use EXTRACTOR to locate the relevant function called for each base &
class field of TYPE.
Use EXTRACTOR to locate the relevant function called for each base & class field of TYPE .