};
/// Thunks - The thunks in a vtable.
- typedef llvm::DenseMap<GlobalDecl, Thunk> ThunksMapTy;
+ typedef llvm::DenseMap<uint64_t, Thunk> ThunksMapTy;
ThunksMapTy Thunks;
/// CovariantThunk - Represents a single covariant thunk.
// Check if there is an adjustment for the 'this' pointer.
ThunkAdjustment ThisAdjustment;
- ThunksMapTy::iterator i = Thunks.find(GD);
+ ThunksMapTy::iterator i = Thunks.find(Index);
if (i != Thunks.end()) {
ThisAdjustment = i->second.Adjustment;
for (ThunksMapTy::const_iterator i = Thunks.begin(), e = Thunks.end();
i != e; ++i) {
- GlobalDecl GD = i->first;
+ GlobalDecl GD = i->second.GD;
const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
assert(!MD->isPure() && "Can't thunk pure virtual methods!");
const Thunk& Thunk = i->second;
- assert(Thunk.Index == Index[GD] && "Thunk index mismatch!");
+ uint64_t Index = Thunk.Index;
+
+ assert(Index == VtableBuilder::Index[GD] && "Thunk index mismatch!");
submethods[Thunk.Index] = CGM.BuildThunk(MD, Extern, Thunk.Adjustment);
}
if (isPure)
PureVirtualMethods.insert(GD);
PureVirtualMethods.erase(OGD);
- Thunks.erase(OGD);
+ Thunks.erase(i);
if (MorallyVirtual || VCall.count(OGD)) {
Index_t &idx = VCall[OGD];
if (idx == 0) {
VirtualAdjustment);
if (!isPure && !ThisAdjustment.isEmpty())
- Thunks[GD] = Thunk(i, GD, ThisAdjustment);
+ Thunks[i] = Thunk(i, GD, ThisAdjustment);
return true;
}
ThunkAdjustment ThisAdjustment(NonVirtualAdjustment, 0);
if (!isPure)
- Thunks[GD] = Thunk(i, GD, ThisAdjustment);
+ Thunks[i] = Thunk(i, GD, ThisAdjustment);
}
return true;
}