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

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

lib/CodeGen/CGVTables.cpp

index 402377cc0fa99423eb34020ac11de5fb1b2d724f..8460bda03c8112420c11f42a156329887025cd29 100644 (file)
@@ -1135,7 +1135,7 @@ private:
   /// \param BaseIsMorallyVirtual whether the base subobject is a virtual base
   /// or a direct or indirect base of a virtual base.
   void LayoutSecondaryVTables(BaseSubobject Base, bool BaseIsMorallyVirtual,
-                              uint64_t OffsetInLayoutClass);
+                              CharUnits OffsetInLayoutClass);
 
   /// DeterminePrimaryVirtualBases - Determine the primary virtual bases in this
   /// class hierarchy.
@@ -1815,13 +1815,12 @@ VTableBuilder::LayoutPrimaryAndSecondaryVTables(BaseSubobject Base,
   }
 
   // Layout secondary vtables.
-  LayoutSecondaryVTables(Base, BaseIsMorallyVirtual, 
-                         Context.toBits(OffsetInLayoutClass));
+  LayoutSecondaryVTables(Base, BaseIsMorallyVirtual, OffsetInLayoutClass);
 }
 
 void VTableBuilder::LayoutSecondaryVTables(BaseSubobject Base,
                                            bool BaseIsMorallyVirtual,
-                                           uint64_t OffsetInLayoutClass) {
+                                           CharUnits OffsetInLayoutClass) {
   // Itanium C++ ABI 2.5.2:
   //   Following the primary virtual table of a derived class are secondary 
   //   virtual tables for each of its proper base classes, except any primary
@@ -1859,14 +1858,13 @@ void VTableBuilder::LayoutSecondaryVTables(BaseSubobject Base,
     CharUnits BaseOffset = Base.getBaseOffset() + RelativeBaseOffset;
     
     CharUnits BaseOffsetInLayoutClass = 
-      Context.toCharUnitsFromBits(OffsetInLayoutClass) + RelativeBaseOffset;
+      OffsetInLayoutClass + RelativeBaseOffset;
     
     // Don't emit a secondary vtable for a primary base. We might however want 
     // to emit secondary vtables for other bases of this base.
     if (BaseDecl == PrimaryBase) {
-      LayoutSecondaryVTables(
-        BaseSubobject(BaseDecl, BaseOffset),
-        BaseIsMorallyVirtual, Context.toBits(BaseOffsetInLayoutClass));
+      LayoutSecondaryVTables(BaseSubobject(BaseDecl, BaseOffset),
+                             BaseIsMorallyVirtual, BaseOffsetInLayoutClass);
       continue;
     }