FreeBSD/contrib/gcc/cp/decl.c
/* Create and return a canonical pointer to member function type, for
   TYPE, which is a POINTER_TYPE to a METHOD_TYPE.  */
Create and return a canonical pointer to member function type, for
TYPE, which is a POINTER_TYPE to a METHOD_TYPE.
Create and return a canonical pointer to member function type for TYPE which is a POINTER_TYPE to a METHOD_TYPE .
tree
build_ptrmemfunc_type (tree type)
{
  tree field, fields;
  tree t;
  tree unqualified_variant = NULL_TREE;
  if (type == error_mark_node)
    return type;
  if ((t = TYPE_GET_PTRMEMFUNC_TYPE (type)))
    return t;
  if (cp_type_quals (type) != TYPE_UNQUALIFIED)
    unqualified_variant
      = build_ptrmemfunc_type (TYPE_MAIN_VARIANT (type));
  t = make_aggr_type (RECORD_TYPE);
  xref_basetypes (t, NULL_TREE);
  TYPE_PTRMEMFUNC_FLAG (t) = 1;
  SET_IS_AGGR_TYPE (t, 0);
  field = build_decl (FIELD_DECL, pfn_identifier, type);
  fields = field;
  field = build_decl (FIELD_DECL, delta_identifier, delta_type_node);
  TREE_CHAIN (field) = fields;
  fields = field;
  finish_builtin_struct (t, "__ptrmemfunc_type", fields, ptr_type_node);
  TYPE_NAME (t) = NULL_TREE;
  if (cp_type_quals (type) != TYPE_UNQUALIFIED)
    {
      t = build_qualified_type (t, cp_type_quals (type));
      TYPE_MAIN_VARIANT (t) = unqualified_variant;
      TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (unqualified_variant);
      TYPE_NEXT_VARIANT (unqualified_variant) = t;
    }
  TYPE_SET_PTRMEMFUNC_TYPE (type, t);
  return t;
}
tree build_ptrmemfunc_type ( tree type ) { tree field , fields ; tree t ; tree unqualified_variant = NULL_TREE ; if ( type == error_mark_node ) return type ; if ( ( t = TYPE_GET_PTRMEMFUNC_TYPE ( type ) ) ) return t ; if ( cp_type_quals ( type ) != TYPE_UNQUALIFIED ) unqualified_variant = build_ptrmemfunc_type ( TYPE_MAIN_VARIANT ( type ) ) ; t = make_aggr_type ( RECORD_TYPE ) ; xref_basetypes ( t , NULL_TREE ) ; TYPE_PTRMEMFUNC_FLAG ( t ) = 1 ; SET_IS_AGGR_TYPE ( t , 0 ) ; field = build_decl ( FIELD_DECL , pfn_identifier , type ) ; fields = field ; field = build_decl ( FIELD_DECL , delta_identifier , delta_type_node ) ; TREE_CHAIN ( field ) = fields ; fields = field ; finish_builtin_struct ( t , " " , fields , ptr_type_node ) ; TYPE_NAME ( t ) = NULL_TREE ; if ( cp_type_quals ( type ) != TYPE_UNQUALIFIED ) { t = build_qualified_type ( t , cp_type_quals ( type ) ) ; TYPE_MAIN_VARIANT ( t ) = unqualified_variant ; TYPE_NEXT_VARIANT ( t ) = TYPE_NEXT_VARIANT ( unqualified_variant ) ; TYPE_NEXT_VARIANT ( unqualified_variant ) = t ; } TYPE_SET_PTRMEMFUNC_TYPE ( type , t ) ; return t ; }
Create and return a canonical pointer to member function type, for
TYPE, which is a POINTER_TYPE to a METHOD_TYPE.
Create and return a canonical pointer to member function type for TYPE which is a POINTER_TYPE to a METHOD_TYPE .
/* If a canonical type already exists for this type, use it.  We use
     this method instead of type_hash_canon, because it only does a
     simple equality check on the list of field members.  */ /* Make sure that we always have the unqualified pointer-to-member
     type first.  */ /* Let the front-end know this is a pointer to member function...  */ /* ... and not really an aggregate.  */ /* Zap out the name so that the back-end will give us the debugging
     information for this anonymous RECORD_TYPE.  */ /* If this is not the unqualified form of this pointer-to-member
     type, set the TYPE_MAIN_VARIANT for this type to be the
     unqualified type.  Since they are actually RECORD_TYPEs that are
     not variants of each other, we must do this manually.  */ /* Cache this pointer-to-member type so that we can find it again
     later.  */