[cfe-commits] r90406 - /cfe/trunk/lib/CodeGen/CGVtable.cpp
Anders Carlsson
andersca at mac.com
Wed Dec 2 19:28:24 PST 2009
Author: andersca
Date: Wed Dec 2 21:28:24 2009
New Revision: 90406
URL: http://llvm.org/viewvc/llvm-project?rev=90406&view=rev
Log:
Revert r90402 for now, virt.cpp is failing.
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=90406&r1=90405&r2=90406&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Wed Dec 2 21:28:24 2009
@@ -274,20 +274,18 @@
Thunks.erase(i);
}
-
- QualType BaseType = QualType(Thunk.ReturnType)->getPointeeType();
+
+ // Construct the return adjustment.
QualType DerivedType =
- MD->getType()->getAs<FunctionType>()->getResultType()->getPointeeType();
+ MD->getType()->getAs<FunctionType>()->getResultType();
- const CXXRecordDecl *BaseDecl =
- cast<CXXRecordDecl>(BaseType->getAs<RecordType>()->getDecl());
+ int64_t NonVirtualAdjustment =
+ getNVOffset(Thunk.ReturnType, DerivedType) / 8;
- const CXXRecordDecl *DerivedDecl =
- cast<CXXRecordDecl>(DerivedType->getAs<RecordType>()->getDecl());
+ int64_t VirtualAdjustment =
+ getVbaseOffset(Thunk.ReturnType, DerivedType);
- // Construct the return adjustment.
- ThunkAdjustment ReturnAdjustment =
- CGM.ComputeThunkAdjustment(DerivedDecl, BaseDecl);
+ ThunkAdjustment ReturnAdjustment(NonVirtualAdjustment, VirtualAdjustment);
CovariantThunkAdjustment Adjustment(ThisAdjustment, ReturnAdjustment);
submethods[Index] = CGM.BuildCovariantThunk(MD, Extern, Adjustment);
@@ -747,7 +745,7 @@
}
const CXXRecordDecl *DerivedDecl =
- cast<CXXRecordDecl>(cast<RecordType>(CanDerivedType)->getDecl());
+ cast<CXXRecordDecl>(cast<RecordType>(CanDerivedType)->getDecl());
const CXXRecordDecl *BaseDecl =
cast<CXXRecordDecl>(cast<RecordType>(CanBaseType)->getDecl());
More information about the cfe-commits
mailing list