[cfe-commits] r90394 - /cfe/trunk/lib/CodeGen/CGVtable.cpp
Anders Carlsson
andersca at mac.com
Wed Dec 2 18:22:59 PST 2009
Author: andersca
Date: Wed Dec 2 20:22:59 2009
New Revision: 90394
URL: http://llvm.org/viewvc/llvm-project?rev=90394&view=rev
Log:
No need to create the covariant thunk in both places now.
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=90394&r1=90393&r2=90394&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Wed Dec 2 20:22:59 2009
@@ -708,7 +708,6 @@
CanQualType oret = CGM.getContext().getCanonicalType(nc_oret);
QualType nc_ret = MD->getType()->getAs<FunctionType>()->getResultType();
CanQualType ret = CGM.getContext().getCanonicalType(nc_ret);
- ThunkAdjustment ReturnAdjustment;
if (oret != ret) {
// FIXME: calculate offsets for covariance
CovariantThunksMapTy::iterator it = CovariantThunks.find(i);
@@ -718,7 +717,10 @@
}
// FIXME: Double check oret
Index_t nv = getNVOffset(oret, ret)/8;
- ReturnAdjustment = ThunkAdjustment(nv, getVbaseOffset(oret, ret));
+ CovariantThunks[i] =
+ CovariantThunk(GD, ThunkAdjustment(nv, getVbaseOffset(oret, ret)),
+ oret);
+
}
Index[GD] = i;
submethods[i] = m;
@@ -756,11 +758,6 @@
ThunkAdjustment ThisAdjustment(NonVirtualAdjustment,
VirtualAdjustment);
- // FIXME: Do we always have to build a covariant thunk to save oret,
- // which is the containing virtual base class?
- if (!ReturnAdjustment.isEmpty())
- CovariantThunks[i] = CovariantThunk(GD, ReturnAdjustment, oret);
-
if (!isPure && !ThisAdjustment.isEmpty())
Thunks[GD] = Thunk(i, ThisAdjustment);
return true;
@@ -769,13 +766,9 @@
// FIXME: finish off
int64_t NonVirtualAdjustment = VCallOffset[OGD] - OverrideOffset/8;
- if (NonVirtualAdjustment || !ReturnAdjustment.isEmpty()) {
+ if (NonVirtualAdjustment) {
ThunkAdjustment ThisAdjustment(NonVirtualAdjustment, 0);
- if (!ReturnAdjustment.isEmpty())
- CovariantThunks[i] =
- CovariantThunk(GD, ReturnAdjustment, oret);
-
if (!isPure)
Thunks[GD] = Thunk(i, ThisAdjustment);
}
More information about the cfe-commits
mailing list