[cfe-commits] r90400 - /cfe/trunk/lib/CodeGen/CGVtable.cpp

Anders Carlsson andersca at mac.com
Wed Dec 2 18:41:55 PST 2009


Author: andersca
Date: Wed Dec  2 20:41:55 2009
New Revision: 90400

URL: http://llvm.org/viewvc/llvm-project?rev=90400&view=rev
Log:
Remove the index from the Thunk struct.

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

Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=90400&r1=90399&r2=90400&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Wed Dec  2 20:41:55 2009
@@ -59,15 +59,11 @@
   
   /// Thunk - Represents a single thunk.
   struct Thunk {
-    Thunk()
-      : Index(0) { }
+    Thunk() { }
     
-    Thunk(uint64_t Index, GlobalDecl GD, const ThunkAdjustment &Adjustment)
-      : Index(Index), GD(GD), Adjustment(Adjustment) { }
+    Thunk(GlobalDecl GD, const ThunkAdjustment &Adjustment)
+      : GD(GD), Adjustment(Adjustment) { }
     
-    /// Index - The index in the vtable.
-    uint64_t Index;
-
     GlobalDecl GD;
 
     /// Adjustment - The thunk adjustment.
@@ -298,16 +294,16 @@
     
     for (ThunksMapTy::const_iterator i = Thunks.begin(), e = Thunks.end();
          i != e; ++i) {
-      GlobalDecl GD = i->second.GD;
+      uint64_t Index = i->first;
+      const Thunk& Thunk = i->second;
+
+      GlobalDecl GD = Thunk.GD;
       const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
       assert(!MD->isPure() && "Can't thunk pure virtual methods!");
-      
-      const Thunk& Thunk = i->second;
-      uint64_t Index = Thunk.Index;
 
       assert(Index == VtableBuilder::Index[GD] && "Thunk index mismatch!");
              
-      submethods[Thunk.Index] = CGM.BuildThunk(MD, Extern, Thunk.Adjustment);
+      submethods[Index] = CGM.BuildThunk(MD, Extern, Thunk.Adjustment);
     }
     Thunks.clear();
 
@@ -851,7 +847,7 @@
                                        VirtualAdjustment);
 
         if (!isPure && !ThisAdjustment.isEmpty())
-          Thunks[i] = Thunk(i, GD, ThisAdjustment);
+          Thunks[i] = Thunk(GD, ThisAdjustment);
         return true;
       }
 
@@ -862,7 +858,7 @@
         ThunkAdjustment ThisAdjustment(NonVirtualAdjustment, 0);
         
         if (!isPure)
-          Thunks[i] = Thunk(i, GD, ThisAdjustment);
+          Thunks[i] = Thunk(GD, ThisAdjustment);
       }
       return true;
     }





More information about the cfe-commits mailing list