]> granicus.if.org Git - clang/commitdiff
Drop the unneeded VBase field from MethodInfo in the VFTableBuilder class
authorTimur Iskhodzhanov <timurrrr@google.com>
Tue, 22 Oct 2013 14:50:20 +0000 (14:50 +0000)
committerTimur Iskhodzhanov <timurrrr@google.com>
Tue, 22 Oct 2013 14:50:20 +0000 (14:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193164 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/VTableBuilder.cpp

index 2da089186c92bb23a4c49868d2e60bf45803226a..a161802b2910b55b66516cd2b6850a05e9a3924c 100644 (file)
@@ -2483,10 +2483,6 @@ private:
     /// this method's base has, or zero.
     const uint64_t VBTableIndex;
 
-    /// VBase - If nonnull, holds the last vbase which contains the vfptr that
-    /// the method definition is adjusted to.
-    const CXXRecordDecl *VBase;
-
     /// VFTableIndex - The index in the vftable that this method has.
     const uint64_t VFTableIndex;
 
@@ -2495,13 +2491,11 @@ private:
     /// or used for vcalls in the most derived class.
     bool Shadowed;
 
-    MethodInfo(uint64_t VBTableIndex, const CXXRecordDecl *VBase,
-               uint64_t VFTableIndex)
-        : VBTableIndex(VBTableIndex), VBase(VBase), VFTableIndex(VFTableIndex),
+    MethodInfo(uint64_t VBTableIndex, uint64_t VFTableIndex)
+        : VBTableIndex(VBTableIndex), VFTableIndex(VFTableIndex),
           Shadowed(false) {}
 
-    MethodInfo()
-        : VBTableIndex(0), VBase(0), VFTableIndex(0), Shadowed(false) {}
+    MethodInfo() : VBTableIndex(0), VFTableIndex(0), Shadowed(false) {}
   };
 
   typedef llvm::DenseMap<const CXXMethodDecl *, MethodInfo> MethodInfoMapTy;
@@ -2579,7 +2573,7 @@ private:
       // and the entries shadowed by return adjusting thunks.
       if (MD->getParent() != MostDerivedClass || MI.Shadowed)
         continue;
-      MethodVFTableLocation Loc(MI.VBTableIndex, MI.VBase,
+      MethodVFTableLocation Loc(MI.VBTableIndex, WhichVFPtr.LastVBase,
                                 WhichVFPtr.VFPtrOffset, MI.VFTableIndex);
       if (const CXXDestructorDecl *DD = dyn_cast<CXXDestructorDecl>(MD)) {
         MethodVFTableLocations[GlobalDecl(DD, Dtor_Deleting)] = Loc;
@@ -2873,7 +2867,6 @@ void VFTableBuilder::AddMethods(BaseSubobject Base, unsigned BaseDepth,
         // No return adjustment needed - just replace the overridden method info
         // with the current info.
         MethodInfo MI(OverriddenMethodInfo.VBTableIndex,
-                      OverriddenMethodInfo.VBase,
                       OverriddenMethodInfo.VFTableIndex);
         MethodInfoMap.erase(OverriddenMDIterator);
 
@@ -2919,7 +2912,7 @@ void VFTableBuilder::AddMethods(BaseSubobject Base, unsigned BaseDepth,
     // it requires return adjustment. Insert the method info for this method.
     unsigned VBIndex =
         LastVBase ? GetVBTableIndex(MostDerivedClass, LastVBase) : 0;
-    MethodInfo MI(VBIndex, LastVBase, Components.size());
+    MethodInfo MI(VBIndex, Components.size());
 
     assert(!MethodInfoMap.count(MD) &&
            "Should not have method info for this method yet!");