Beispiel #1
0
 void delete_unused_bridgees() {
   for (auto bpair : m_bridges_to_bridgees) {
     auto bridge = bpair.first;
     auto bridgee = bpair.second;
     always_assert_log(bridge->is_virtual(),
                       "bridge: %s\nbridgee: %s",
                       SHOW(bridge),
                       SHOW(bridgee));
     // TODO: Bridgee won't necessarily be direct once we expand this
     // optimization
     assert(!bridgee->is_virtual());
     auto cls = type_class(bridgee->get_class());
     cls->get_dmethods().remove(bridgee);
   }
 }
Beispiel #2
0
PUBLIC
void 
Mem_desc::dump() const
{
  printf("%s [%016lx-%016lx] %s\n", is_virtual()?"virt":"phys",
      start(), end() + 1, memory_desc_types[type()]);
}
Beispiel #3
0
static void traverse_base_classes(
			void					*ptr,
			a_type_info_impl_ptr			class_info,
			a_base_class_traversal_block_ptr	bctbp,
			a_base_class_spec_ptr			curr_base_info)
/*
Walk the base classes of the object specified by "ptr" of the type specified
by "class_info".  Call user-supplied routines as specified in the traversal
block.  This routine is called for the most derived class and then calls itself
recursively for all of the base classes.  When called for a base class,
"curr_base_info" points to the base class specification entry for the current
base class.  This will be NULL for the most derived class, and may also be NULL
for certain base classes in the IA-64 ABI.
*/
{
#ifdef __EDG_IA64_ABI
  /* IA-64 ABI version. */
  a_base_class_spec_ptr	bcsp;
  void                  *new_ptr;

  /* Call the processing function on this base class. */
  bctbp->process_function(ptr, class_info, bctbp, curr_base_info);
  if (typeid(*class_info) == typeid(abi::__si_class_type_info)) {
    abi::__si_class_type_info *si_obj_info = 
                                      (abi::__si_class_type_info *)class_info;
    /* Call the traversal routine on the base class. */
    traverse_base_classes(ptr, si_obj_info->__base_type, bctbp,
                          (a_base_class_spec_ptr)NULL);
  } else if (typeid(*class_info) == typeid(abi::__vmi_class_type_info)) {
    abi::__vmi_class_type_info *vmi_obj_info = 
                                     (abi::__vmi_class_type_info *)class_info;
    for (bcsp = vmi_obj_info->__base_info;
         bcsp < vmi_obj_info->__base_info + vmi_obj_info->__base_count;
         bcsp++) {
      /* If this base class is not public, skip it if only processing public
         bases. */
      if (bctbp->public_only && (bcsp->__offset_flags & BCS_PUBLIC) == 0) {
        continue;
      }  /* if */
      if (is_virtual(bcsp)) {
        new_ptr = get_virtual_base_pointer(ptr, bcsp);
      } else {
        new_ptr = (void *)(((char *)ptr) + get_offset(bcsp));
      }  /* if */
      /* Call the traversal routine on the base class. */
      traverse_base_classes(new_ptr, bcsp->__base_type, bctbp, bcsp);
      /* Stop the traversal if the terminate flag has been set. */
      if (bctbp->terminate) goto end_of_routine;
    }  /* for */
  }  /* if */
  /* Call the post-processing function on this base class. */
  if (bctbp->process_post_function != NULL) {
    bctbp->process_post_function(ptr, class_info, bctbp, curr_base_info);
  }  /* if */
end_of_routine:;
#else /* ifndef __EDG_IA64_ABI */
  /* Extended cfront ABI version. */
  a_base_class_spec_ptr	bcsp;
  void                  *new_ptr;
  a_boolean		done;

  /* Call the processing function on this base class. */
  bctbp->process_function(ptr, class_info, bctbp, curr_base_info);
  for (done = FALSE, bcsp = class_info->base_class_entries;
       bcsp != NULL && !done; done = (bcsp->flags & BCS_LAST) != 0, bcsp++) {
    /* Skip this base class if we are only processing direct bases. */
    if (!bctbp->not_direct_only && (bcsp->flags & BCS_DIRECT) == 0) continue;
    /* If this base class is not public, skip it if only processing public
       bases. */
    if (bctbp->public_only && (bcsp->flags & BCS_PUBLIC) == 0) continue;
    /* Adjust the pointer by the offset provided in the base class
       specification. */
    new_ptr = (void*) (((char *) ptr) + bcsp->offset);
    if (is_virtual(bcsp)) {
      /* If this is a virtual base class then the offset provides the
         location of a pointer to the base class.  Dereference the
         pointer and use that value. */
      new_ptr = *((void **)new_ptr);
    }  /* if */
    traverse_base_classes(new_ptr, bcsp->type_info, bctbp, bcsp);
    /* Stop the traversal if the terminate flag has been set. */
    if (bctbp->terminate) goto end_of_routine;
  }  /* for */
  /* Call the post-processing function on this base class. */
  if (bctbp->process_post_function != NULL) {
    bctbp->process_post_function(ptr, class_info, bctbp, curr_base_info);
  }  /* if */
end_of_routine:;
#endif /* ifdef __EDG_IA64_ABI */
}  /* traverse_base_classes */