FreeBSD/contrib/gcc/cp/class.c
/* Given a stable object pointer INSTANCE_PTR, return an expression which
   yields a function pointer corresponding to vtable element INDEX.  */
Given a stable object pointer INSTANCE_PTR, return an expression which
yields a function pointer corresponding to vtable element INDEX.
Given a stable object pointer INSTANCE_PTR return an expression which yields a function pointer corresponding to vtable element INDEX .
tree
build_vfn_ref (tree instance_ptr, tree idx)
{
  tree aref;
  aref = build_vtbl_ref_1 (build_indirect_ref (instance_ptr, 0), idx);
  if (TARGET_VTABLE_USES_DESCRIPTORS)
    aref = build1 (NOP_EXPR, TREE_TYPE (aref),
		   build_unary_op (ADDR_EXPR, aref, 1));
  aref = build3 (OBJ_TYPE_REF, TREE_TYPE (aref), aref, instance_ptr, idx);
  return aref;
}
tree build_vfn_ref ( tree instance_ptr , tree idx ) { tree aref ; aref = build_vtbl_ref_1 ( build_indirect_ref ( instance_ptr , 0 ) , idx ) ; if ( TARGET_VTABLE_USES_DESCRIPTORS ) aref = build1 ( NOP_EXPR , TREE_TYPE ( aref ) , build_unary_op ( ADDR_EXPR , aref , 1 ) ) ; aref = build3 ( OBJ_TYPE_REF , TREE_TYPE ( aref ) , aref , instance_ptr , idx ) ; return aref ; }
Given a stable object pointer INSTANCE_PTR, return an expression which
yields a function pointer corresponding to vtable element INDEX.
Given a stable object pointer INSTANCE_PTR return an expression which yields a function pointer corresponding to vtable element INDEX .
/* When using function descriptors, the address of the
     vtable entry is treated as a function pointer.  */ /*noconvert=*/ /* Remember this as a method reference, for later devirtualization.  */