]> granicus.if.org Git - clang/commitdiff
Convert the OffsetInLayoutClass parameter of DeterminePrimaryVirtualBases()
authorKen Dyck <kd@kendyck.com>
Wed, 30 Mar 2011 01:10:23 +0000 (01:10 +0000)
committerKen Dyck <kd@kendyck.com>
Wed, 30 Mar 2011 01:10:23 +0000 (01:10 +0000)
to CharUnits. No change in functionality intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128520 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVTables.cpp

index 8460bda03c8112420c11f42a156329887025cd29..b42c9fb613760faa642ec94a7d94531ee998b56f 100644 (file)
@@ -1140,7 +1140,7 @@ private:
   /// DeterminePrimaryVirtualBases - Determine the primary virtual bases in this
   /// class hierarchy.
   void DeterminePrimaryVirtualBases(const CXXRecordDecl *RD, 
-                                    uint64_t OffsetInLayoutClass,
+                                    CharUnits OffsetInLayoutClass,
                                     VisitedVirtualBasesSetTy &VBases);
 
   /// LayoutVTablesForVirtualBases - Layout vtables for all virtual bases of the
@@ -1733,8 +1733,8 @@ void VTableBuilder::LayoutVTable() {
   VisitedVirtualBasesSetTy VBases;
   
   // Determine the primary virtual bases.
-  DeterminePrimaryVirtualBases(MostDerivedClass, 
-                               Context.toBits(MostDerivedClassOffset), VBases);
+  DeterminePrimaryVirtualBases(MostDerivedClass, MostDerivedClassOffset, 
+                               VBases);
   VBases.clear();
   
   LayoutVTablesForVirtualBases(MostDerivedClass, VBases);
@@ -1879,7 +1879,7 @@ void VTableBuilder::LayoutSecondaryVTables(BaseSubobject Base,
 
 void
 VTableBuilder::DeterminePrimaryVirtualBases(const CXXRecordDecl *RD,
-                                            uint64_t OffsetInLayoutClass,
+                                            CharUnits OffsetInLayoutClass,
                                             VisitedVirtualBasesSetTy &VBases) {
   const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
   
@@ -1896,8 +1896,8 @@ VTableBuilder::DeterminePrimaryVirtualBases(const CXXRecordDecl *RD,
         const ASTRecordLayout &LayoutClassLayout =
           Context.getASTRecordLayout(LayoutClass);
 
-        uint64_t PrimaryBaseOffsetInLayoutClass =
-          LayoutClassLayout.getVBaseClassOffsetInBits(PrimaryBase);
+        CharUnits PrimaryBaseOffsetInLayoutClass =
+          LayoutClassLayout.getVBaseClassOffset(PrimaryBase);
         
         // We know that the base is not a primary base in the layout class if 
         // the base offsets are different.
@@ -1916,7 +1916,7 @@ VTableBuilder::DeterminePrimaryVirtualBases(const CXXRecordDecl *RD,
     const CXXRecordDecl *BaseDecl = 
       cast<CXXRecordDecl>(I->getType()->getAs<RecordType>()->getDecl());
 
-    uint64_t BaseOffsetInLayoutClass;
+    CharUnits BaseOffsetInLayoutClass;
     
     if (I->isVirtual()) {
       if (!VBases.insert(BaseDecl))
@@ -1926,10 +1926,10 @@ VTableBuilder::DeterminePrimaryVirtualBases(const CXXRecordDecl *RD,
         Context.getASTRecordLayout(LayoutClass);
 
       BaseOffsetInLayoutClass = 
-        LayoutClassLayout.getVBaseClassOffsetInBits(BaseDecl);
+        LayoutClassLayout.getVBaseClassOffset(BaseDecl);
     } else {
       BaseOffsetInLayoutClass = 
-        OffsetInLayoutClass + Layout.getBaseClassOffsetInBits(BaseDecl);
+        OffsetInLayoutClass + Layout.getBaseClassOffset(BaseDecl);
     }
 
     DeterminePrimaryVirtualBases(BaseDecl, BaseOffsetInLayoutClass, VBases);