Remove the index from the Thunk struct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90400 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp
index e76ae83..007960e 100644
--- a/lib/CodeGen/CGVtable.cpp
+++ b/lib/CodeGen/CGVtable.cpp
@@ -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;
     }