diff options
author | Anders Carlsson <andersca@mac.com> | 2009-12-03 02:16:14 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-12-03 02:16:14 +0000 |
commit | 5f96bc1281133d325f7f28037e5cdddc88de76fa (patch) | |
tree | 1ae41d22989ccdcf50a95a0c88af31f9452be801 /lib/CodeGen | |
parent | d6f7af5087ff637d559b815f5f2dd748677185da (diff) |
Remove the index field from the CovariantThunk structure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90392 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGVtable.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp index 45b8be937c..c010f74b2d 100644 --- a/lib/CodeGen/CGVtable.cpp +++ b/lib/CodeGen/CGVtable.cpp @@ -78,18 +78,11 @@ private: /// 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 @@ public: 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 @@ public: CovariantThunkAdjustment Adjustment(ThisAdjustment, Thunk.ReturnAdjustment); - submethods[Thunk.Index] = - CGM.BuildCovariantThunk(MD, Extern, Adjustment); + submethods[Index] = CGM.BuildCovariantThunk(MD, Extern, Adjustment); } CovariantThunks.clear(); |