On Jul 25, 2013, at 10:16 AM, Timur Iskhodzhanov <[email protected]> wrote:
>  Fixed wording in one of the comments.

+visitAllOverriddenMethods(const CXXMethodDecl *MD,
+                          VisitorTy &Visitor,
+                          OverriddenMethodsSetTy &VisitedMethods) {

Don’t have this take VisitedMethods.  Make the visitor that cares about
collecting methods collect them.

-ComputeAllOverriddenMethods(const CXXMethodDecl *MD,
-                            OverriddenMethodsSetTy& OverriddenMethods) {

You can actually leave this function around if you like.  It’s just:

namespace {
  struct MethodCollector {
    OverriddenMethodsSetTy *Methods;
    bool visit(const CXXMethodDecl *MD) {
      Methods->push_back(MD);
      return true;
    }
  };
}
void ComputeAllOverriddenMethods(const CXXMethodDecl *MD,
                            OverriddenMethodsSetTy& OverriddenMethods) {
  MethodCollector collector = { &OverriddenMethods };
  visitAllOverriddenMethods(MD, collector);
}

+static const CXXMethodDecl *
 FindNearestOverriddenMethod(const CXXMethodDecl *MD,
-                            VTableBuilder::PrimaryBasesSetVectorTy &Bases) {
+                            BasesSetVectorTy &Bases) {

Sorry, I didn’t mean to ask you to rewrite this algorithm; I just wanted a way 
to
re-use the recursive visitation without redundantly copying them out into an 
array
if that wasn’t needed.

+    ThisAdjustment ThisAdjustmentOffset;
+    // Check if this virtual member function overrides
+    // a method in one of the visited bases.
+    if (const CXXMethodDecl *OverriddenMD =
+            FindDirectlyOverriddenMethodInBases(MD, VisitedBases)) {
+      // Replace the method info of the overridden method with our own
+      // method - only if it's in the vftable we're laying out.
+      MethodInfoMapTy::iterator OverriddenMDIterator =

I’m confused about what’s actually going into MethodInfoMap and what
needs to be replaced, exactly.

John.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to