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

Ken Dyck kd at kendyck.com
Fri Apr 1 17:44:58 PDT 2011


Author: kjdyck
Date: Fri Apr  1 19:44:58 2011
New Revision: 128752

URL: http://llvm.org/viewvc/llvm-project?rev=128752&view=rev
Log:
Convert offset parameters of VTableBuilder::IsOverriderUsed() 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=128752&r1=128751&r2=128752&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTables.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTables.cpp Fri Apr  1 19:44:58 2011
@@ -1101,9 +1101,9 @@
   ///   C-in-D's copy of A's vtable is never referenced, so this is not 
   ///   necessary.
   bool IsOverriderUsed(const CXXMethodDecl *Overrider,
-                       uint64_t BaseOffsetInLayoutClass,
+                       CharUnits BaseOffsetInLayoutClass,
                        const CXXRecordDecl *FirstBaseInPrimaryBaseChain,
-                       uint64_t FirstBaseOffsetInLayoutClass) const;
+                       CharUnits FirstBaseOffsetInLayoutClass) const;
 
   
   /// AddMethods - Add the methods of this base subobject and all its
@@ -1500,9 +1500,9 @@
 
 bool 
 VTableBuilder::IsOverriderUsed(const CXXMethodDecl *Overrider,
-                               uint64_t BaseOffsetInLayoutClass,
+                               CharUnits BaseOffsetInLayoutClass,
                                const CXXRecordDecl *FirstBaseInPrimaryBaseChain,
-                               uint64_t FirstBaseOffsetInLayoutClass) const {
+                               CharUnits FirstBaseOffsetInLayoutClass) const {
   // If the base and the first base in the primary base chain have the same
   // offsets, then this overrider will be used.
   if (BaseOffsetInLayoutClass == FirstBaseOffsetInLayoutClass)
@@ -1540,7 +1540,7 @@
 
       // Now check if this is the primary base that is not a primary base in the
       // most derived class.
-      if (LayoutClassLayout.getVBaseClassOffsetInBits(PrimaryBase) !=
+      if (LayoutClassLayout.getVBaseClassOffset(PrimaryBase) !=
           FirstBaseOffsetInLayoutClass) {
         // We found it, stop walking the chain.
         break;
@@ -1703,9 +1703,9 @@
 
     // Check if this overrider is going to be used.
     const CXXMethodDecl *OverriderMD = Overrider.Method;
-    if (!IsOverriderUsed(OverriderMD, Context.toBits(BaseOffsetInLayoutClass),
+    if (!IsOverriderUsed(OverriderMD, BaseOffsetInLayoutClass,
                          FirstBaseInPrimaryBaseChain, 
-                         Context.toBits(FirstBaseOffsetInLayoutClass))) {
+                         FirstBaseOffsetInLayoutClass)) {
       Components.push_back(VTableComponent::MakeUnusedFunction(OverriderMD));
       continue;
     }





More information about the cfe-commits mailing list