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

Anders Carlsson andersca at mac.com
Wed Dec 2 18:16:14 PST 2009


Author: andersca
Date: Wed Dec  2 20:16:14 2009
New Revision: 90392

URL: http://llvm.org/viewvc/llvm-project?rev=90392&view=rev
Log:
Remove the index field from the CovariantThunk structure.

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=90392&r1=90391&r2=90392&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Wed Dec  2 20:16:14 2009
@@ -78,18 +78,11 @@
 
   /// CovariantThunk - Represents a single covariant thunk.
   struct CovariantThunk {
-    CovariantThunk()
-      : Index(0) { }
-    
-    CovariantThunk(uint64_t Index, GlobalDecl GD,
-                   const ThunkAdjustment &ReturnAdjustment, 
+    CovariantThunk(GlobalDecl GD, const ThunkAdjustment &ReturnAdjustment, 
                    CanQualType ReturnType) 
-      : Index(Index), GD(GD), ReturnAdjustment(ReturnAdjustment), 
+      : GD(GD), ReturnAdjustment(ReturnAdjustment), 
       ReturnType(ReturnType) { }
-    
-    // Index - The index in the vtable.
-    uint64_t Index;
-    
+
     GlobalDecl GD;
     
     /// ReturnAdjustment - The covariant thunk return adjustment.
@@ -274,14 +267,14 @@
       if (MD->isPure())
         continue;
       
+      uint64_t Index = i->first;
       const CovariantThunk &Thunk = i->second;
-      assert(Thunk.Index == Index[GD] && "Thunk index mismatch!");
+      assert(Index == VtableBuilder::Index[GD] && "Thunk index mismatch!");
       
       // Check if there is an adjustment for the 'this' pointer.
       ThunkAdjustment ThisAdjustment;
       ThunksMapTy::iterator i = Thunks.find(GD);
       if (i != Thunks.end()) {
-        assert(i->second.Index == Thunk.Index && "Thunk index mismatch!");
         ThisAdjustment = i->second.Adjustment;
         
         Thunks.erase(i);
@@ -289,8 +282,7 @@
         
       CovariantThunkAdjustment Adjustment(ThisAdjustment, 
                                           Thunk.ReturnAdjustment);
-      submethods[Thunk.Index] = 
-        CGM.BuildCovariantThunk(MD, Extern, Adjustment);
+      submethods[Index] = CGM.BuildCovariantThunk(MD, Extern, Adjustment);
     }
     CovariantThunks.clear();
     





More information about the cfe-commits mailing list