]> granicus.if.org Git - clang/commitdiff
More work in preparation of getting rid of the submethods loop.
authorAnders Carlsson <andersca@mac.com>
Fri, 4 Dec 2009 03:52:52 +0000 (03:52 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 4 Dec 2009 03:52:52 +0000 (03:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90535 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVtable.cpp

index defa809766d214cef7dc33888a26c77412d98297..4cf158a9222192ed2c6d12a019e1c279830cf635 100644 (file)
@@ -754,7 +754,9 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, llvm::Constant *m,
       if (submethods[i] != om)
         continue;
 
-      assert(i == Methods.getIndex(OGD));
+      uint64_t Index = Methods.getIndex(OGD);
+
+      assert(i == Index);
       
       QualType ReturnType = 
         MD->getType()->getAs<FunctionType>()->getResultType();
@@ -778,7 +780,7 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, llvm::Constant *m,
 
       Methods.OverrideMethod(OGD, GD);
 
-      submethods[i] = m;
+      submethods[Index] = m;
       ThisAdjustments.erase(i);
       if (MorallyVirtual || VCall.count(OGD)) {
         Index_t &idx = VCall[OGD];
@@ -811,7 +813,7 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, llvm::Constant *m,
                                        VirtualAdjustment);
 
         if (!isPure && !ThisAdjustment.isEmpty())
-          ThisAdjustments[i] = ThisAdjustment;
+          ThisAdjustments[Index] = ThisAdjustment;
         return true;
       }
 
@@ -822,7 +824,7 @@ bool VtableBuilder::OverrideMethod(GlobalDecl GD, llvm::Constant *m,
         ThunkAdjustment ThisAdjustment(NonVirtualAdjustment, 0);
         
         if (!isPure)
-          ThisAdjustments[i] = ThisAdjustment;
+          ThisAdjustments[Index] = ThisAdjustment;
       }
       return true;
     }