[cfe-commits] r90105 - /cfe/trunk/lib/CodeGen/CGVtable.cpp

Eli Friedman eli.friedman at gmail.com
Sun Nov 29 17:19:33 PST 2009


Author: efriedma
Date: Sun Nov 29 19:19:33 2009
New Revision: 90105

URL: http://llvm.org/viewvc/llvm-project?rev=90105&view=rev
Log:
Minor cleanup (no functionality change).


Modified:
    cfe/trunk/lib/CodeGen/CGVtable.cpp

Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=90105&r1=90104&r2=90105&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Sun Nov 29 19:19:33 2009
@@ -205,8 +205,6 @@
     SeenVBase.clear();
   }
 
-  Index_t VBlookup(CXXRecordDecl *D, CXXRecordDecl *B);
-
   Index_t getNVOffset_1(const CXXRecordDecl *D, const CXXRecordDecl *B,
     Index_t Offset = 0) {
 
@@ -252,7 +250,7 @@
     CXXRecordDecl *D = cast<CXXRecordDecl>(qD->getAs<RecordType>()->getDecl());
     CXXRecordDecl *B = cast<CXXRecordDecl>(qB->getAs<RecordType>()->getDecl());
     if (D != Class)
-      return VBlookup(D, B);
+      return CGM.getVtableInfo().getVirtualBaseOffsetIndex(D, B);
     llvm::DenseMap<const CXXRecordDecl *, Index_t>::iterator i;
     i = VBIndex.find(B);
     if (i != VBIndex.end())
@@ -455,7 +453,7 @@
   }
 
   void AddMethod(const GlobalDecl GD, bool MorallyVirtual, Index_t Offset,
-                 bool ForVirtualBase, int64_t CurrentVBaseOffset) {
+                 int64_t CurrentVBaseOffset) {
     llvm::Constant *m = WrapAddrOf(GD);
 
     // If we can find a previously allocated slot for this, reuse it.
@@ -487,8 +485,7 @@
   }
 
   void AddMethods(const CXXRecordDecl *RD, bool MorallyVirtual,
-                  Index_t Offset, bool RDisVirtualBase,
-                  int64_t CurrentVBaseOffset) {
+                  Index_t Offset, int64_t CurrentVBaseOffset) {
     for (method_iter mi = RD->method_begin(), me = RD->method_end(); mi != me;
          ++mi) {
       const CXXMethodDecl *MD = *mi;
@@ -499,12 +496,11 @@
         // For destructors, add both the complete and the deleting destructor
         // to the vtable.
         AddMethod(GlobalDecl(DD, Dtor_Complete), MorallyVirtual, Offset, 
-                  RDisVirtualBase, CurrentVBaseOffset);
+                  CurrentVBaseOffset);
         AddMethod(GlobalDecl(DD, Dtor_Deleting), MorallyVirtual, Offset, 
-                  RDisVirtualBase, CurrentVBaseOffset);
-      } else
-        AddMethod(MD, MorallyVirtual, Offset, RDisVirtualBase,
                   CurrentVBaseOffset);
+      } else
+        AddMethod(MD, MorallyVirtual, Offset, CurrentVBaseOffset);
     }
   }
 
@@ -630,7 +626,7 @@
 
   void Primaries(const CXXRecordDecl *RD, bool MorallyVirtual, int64_t Offset,
                  bool updateVBIndex, Index_t current_vbindex,
-                 bool RDisVirtualBase, int64_t CurrentVBaseOffset) {
+                 int64_t CurrentVBaseOffset) {
     if (!RD->isDynamicClass())
       return;
 
@@ -649,21 +645,20 @@
         
       if (!PrimaryBaseWasVirtual)
         Primaries(PrimaryBase, PrimaryBaseWasVirtual|MorallyVirtual, Offset,
-                  updateVBIndex, current_vbindex, PrimaryBaseWasVirtual,
-                  BaseCurrentVBaseOffset);
+                  updateVBIndex, current_vbindex, BaseCurrentVBaseOffset);
     }
 
     D1(printf(" doing vcall entries for %s most derived %s\n",
               RD->getNameAsCString(), Class->getNameAsCString()));
 
     // And add the virtuals for the class to the primary vtable.
-    AddMethods(RD, MorallyVirtual, Offset, RDisVirtualBase, CurrentVBaseOffset);
+    AddMethods(RD, MorallyVirtual, Offset, CurrentVBaseOffset);
   }
 
   void VBPrimaries(const CXXRecordDecl *RD, bool MorallyVirtual, int64_t Offset,
                    bool updateVBIndex, Index_t current_vbindex,
                    bool RDisVirtualBase, int64_t CurrentVBaseOffset,
-                   bool bottom=false) {
+                   bool bottom) {
     if (!RD->isDynamicClass())
       return;
 
@@ -684,7 +679,7 @@
       
       VBPrimaries(PrimaryBase, PrimaryBaseWasVirtual|MorallyVirtual, Offset,
                   updateVBIndex, current_vbindex, PrimaryBaseWasVirtual,
-                  BaseCurrentVBaseOffset);
+                  BaseCurrentVBaseOffset, false);
     }
 
     D1(printf(" doing vbase entries for %s most derived %s\n",
@@ -693,7 +688,7 @@
 
     if (RDisVirtualBase || bottom) {
       Primaries(RD, MorallyVirtual, Offset, updateVBIndex, current_vbindex,
-                RDisVirtualBase, CurrentVBaseOffset);
+                CurrentVBaseOffset);
     }
   }
 
@@ -776,12 +771,6 @@
   }
 };
 
-
-VtableBuilder::Index_t VtableBuilder::VBlookup(CXXRecordDecl *D,
-                                               CXXRecordDecl *B) {
-  return CGM.getVtableInfo().getVirtualBaseOffsetIndex(D, B);
-}
-
 }
 
 /// TypeConversionRequiresAdjustment - Returns whether conversion from a 





More information about the cfe-commits mailing list