[cfe-commits] r90524 - /cfe/trunk/lib/CodeGen/CGVtable.cpp
Anders Carlsson
andersca at mac.com
Thu Dec 3 18:26:16 PST 2009
Author: andersca
Date: Thu Dec 3 20:26:15 2009
New Revision: 90524
URL: http://llvm.org/viewvc/llvm-project?rev=90524&view=rev
Log:
Get rid of the Thunks struct too.
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=90524&r1=90523&r2=90524&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Thu Dec 3 20:26:15 2009
@@ -114,20 +114,10 @@
/// Methods - The vtable methods we're currently building.
VtableMethods Methods;
- /// Thunk - Represents a single thunk.
- struct Thunk {
- Thunk() { }
-
- Thunk(const ThunkAdjustment &Adjustment)
- : Adjustment(Adjustment) { }
-
- /// Adjustment - The thunk adjustment.
- ThunkAdjustment Adjustment;
- };
-
- /// Thunks - The thunks in a vtable.
- typedef llvm::DenseMap<uint64_t, Thunk> ThunksMapTy;
- ThunksMapTy Thunks;
+ /// ThisAdjustments - For a given index in the vtable, contains the 'this'
+ /// pointer adjustment needed for a method.
+ typedef llvm::DenseMap<uint64_t, ThunkAdjustment> ThisAdjustmentsMapTy;
+ ThisAdjustmentsMapTy ThisAdjustments;
/// BaseReturnTypes - Contains the base return types of methods who have been
/// overridden with methods whose return types require adjustment. Used for
@@ -314,11 +304,11 @@
// Check if there is an adjustment for the 'this' pointer.
ThunkAdjustment ThisAdjustment;
- ThunksMapTy::iterator it = Thunks.find(Index);
- if (it != Thunks.end()) {
- ThisAdjustment = it->second.Adjustment;
+ ThisAdjustmentsMapTy::iterator it = ThisAdjustments.find(Index);
+ if (it != ThisAdjustments.end()) {
+ ThisAdjustment = it->second;
- Thunks.erase(it);
+ ThisAdjustments.erase(it);
}
// Construct the return adjustment.
@@ -338,20 +328,20 @@
}
BaseReturnTypes.clear();
- for (ThunksMapTy::const_iterator i = Thunks.begin(), e = Thunks.end();
- i != e; ++i) {
+ for (ThisAdjustmentsMapTy::const_iterator i = ThisAdjustments.begin(),
+ e = ThisAdjustments.end(); i != e; ++i) {
uint64_t Index = i->first;
GlobalDecl GD = Methods[Index];
- const Thunk& Thunk = i->second;
+ const ThunkAdjustment &ThisAdjustment = i->second;
const CXXMethodDecl *MD = cast<CXXMethodDecl>(GD.getDecl());
assert(!MD->isPure() && "Can't thunk pure virtual methods!");
assert(Index == VtableBuilder::Index[GD] && "Thunk index mismatch!");
- submethods[Index] = CGM.BuildThunk(GD, Extern, Thunk.Adjustment);
+ submethods[Index] = CGM.BuildThunk(GD, Extern, ThisAdjustment);
}
- Thunks.clear();
+ ThisAdjustments.clear();
for (PureVirtualMethodsSetTy::iterator i = PureVirtualMethods.begin(),
e = PureVirtualMethods.end(); i != e; ++i) {
@@ -865,7 +855,7 @@
if (isPure)
PureVirtualMethods.insert(GD);
PureVirtualMethods.erase(OGD);
- Thunks.erase(i);
+ ThisAdjustments.erase(i);
if (MorallyVirtual || VCall.count(OGD)) {
Index_t &idx = VCall[OGD];
if (idx == 0) {
@@ -897,7 +887,7 @@
VirtualAdjustment);
if (!isPure && !ThisAdjustment.isEmpty())
- Thunks[i] = Thunk(ThisAdjustment);
+ ThisAdjustments[i] = ThisAdjustment;
return true;
}
@@ -908,7 +898,7 @@
ThunkAdjustment ThisAdjustment(NonVirtualAdjustment, 0);
if (!isPure)
- Thunks[i] = Thunk(ThisAdjustment);
+ ThisAdjustments[i] = ThisAdjustment;
}
return true;
}
More information about the cfe-commits
mailing list