aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGVtable.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-03 03:28:24 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-03 03:28:24 +0000
commit1750b4f1bd2544c3596239a68cd4645a0be02c56 (patch)
tree72e86738f912d9036f0a3715ea5ce10ffe1de168 /lib/CodeGen/CGVtable.cpp
parent81a958366873c8bb49a2ed7324f004047ec18e48 (diff)
Revert r90402 for now, virt.cpp is failing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90406 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVtable.cpp')
-rw-r--r--lib/CodeGen/CGVtable.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/CodeGen/CGVtable.cpp b/lib/CodeGen/CGVtable.cpp
index caac827016..007960e998 100644
--- a/lib/CodeGen/CGVtable.cpp
+++ b/lib/CodeGen/CGVtable.cpp
@@ -274,20 +274,18 @@ public:
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 @@ TypeConversionRequiresAdjustment(ASTContext &Ctx,
}
const CXXRecordDecl *DerivedDecl =
- cast<CXXRecordDecl>(cast<RecordType>(CanDerivedType)->getDecl());
+ cast<CXXRecordDecl>(cast<RecordType>(CanDerivedType)->getDecl());
const CXXRecordDecl *BaseDecl =
cast<CXXRecordDecl>(cast<RecordType>(CanBaseType)->getDecl());