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 | 06c14b6f65e80549366f31d70ccd2612cecf47a3 (patch) | |
tree | 34f51f5f3611d3580d92055dc6b8afd053e46c0b | |
parent | 73295f96c539e09b711f05e8e4ff7e579b6a6169 (diff) | |
download | bcm5719-llvm-06c14b6f65e80549366f31d70ccd2612cecf47a3.tar.gz bcm5719-llvm-06c14b6f65e80549366f31d70ccd2612cecf47a3.zip |
Remove the index field from the CovariantThunk structure.
llvm-svn: 90392
-rw-r--r-- | clang/lib/CodeGen/CGVtable.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/clang/lib/CodeGen/CGVtable.cpp b/clang/lib/CodeGen/CGVtable.cpp index 45b8be937c9..c010f74b2d8 100644 --- a/clang/lib/CodeGen/CGVtable.cpp +++ b/clang/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(); |