[cfe-commits] r128384 - /cfe/trunk/lib/CodeGen/CGVTables.cpp

Ken Dyck kd at kendyck.com
Sun Mar 27 12:03:44 PDT 2011


Author: kjdyck
Date: Sun Mar 27 14:03:44 2011
New Revision: 128384

URL: http://llvm.org/viewvc/llvm-project?rev=128384&view=rev
Log:
Convert the BaseOffsetInLayoutClass parameter of ComputeThisAdjustment() to
CharUnits. No change in functionality intended.

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

Modified: cfe/trunk/lib/CodeGen/CGVTables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTables.cpp?rev=128384&r1=128383&r2=128384&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Sun Mar 27 14:03:44 2011
@@ -1073,7 +1073,7 @@
   /// final overrider.
   ThisAdjustment 
   ComputeThisAdjustment(const CXXMethodDecl *MD, 
-                        uint64_t BaseOffsetInLayoutClass,
+                        CharUnits BaseOffsetInLayoutClass,
                         FinalOverriders::OverriderInfo Overrider);
 
   /// AddMethod - Add a single virtual member function to the vtable
@@ -1276,8 +1276,7 @@
     }
 
     ThisAdjustment ThisAdjustment =
-      ComputeThisAdjustment(MD, 
-          Context.toBits(MethodInfo.BaseOffsetInLayoutClass), Overrider);
+      ComputeThisAdjustment(MD, MethodInfo.BaseOffsetInLayoutClass, Overrider);
 
     if (ThisAdjustment.isEmpty())
       continue;
@@ -1401,15 +1400,14 @@
   
 ThisAdjustment 
 VTableBuilder::ComputeThisAdjustment(const CXXMethodDecl *MD, 
-                                     uint64_t BaseOffsetInLayoutClass,
+                                     CharUnits BaseOffsetInLayoutClass,
                                      FinalOverriders::OverriderInfo Overrider) {
   // Ignore adjustments for pure virtual member functions.
   if (Overrider.Method->isPure())
     return ThisAdjustment();
   
-  BaseSubobject OverriddenBaseSubobject(MD->getParent(),
-                                        Context.toCharUnitsFromBits(
-                                          BaseOffsetInLayoutClass));
+  BaseSubobject OverriddenBaseSubobject(MD->getParent(), 
+                                        BaseOffsetInLayoutClass);
   
   BaseSubobject OverriderBaseSubobject(Overrider.Method->getParent(),
                                        Overrider.Offset);
@@ -1669,8 +1667,9 @@
         if (!isBuildingConstructorVTable() && OverriddenMD != MD) {
           // Compute the this adjustment.
           ThisAdjustment ThisAdjustment =
-            ComputeThisAdjustment(OverriddenMD, BaseOffsetInLayoutClass,
-                                  Overrider);
+            ComputeThisAdjustment(OverriddenMD, 
+                           Context.toCharUnitsFromBits(BaseOffsetInLayoutClass),
+                           Overrider);
 
           if (ThisAdjustment.VCallOffsetOffset &&
               Overrider.Method->getParent() == MostDerivedClass) {





More information about the cfe-commits mailing list