Only add thunks for the most derived class. This fixes some link errors I was seeing in files generated by the vtable tester utility.

llvm-svn: 99801
This commit is contained in:
Anders Carlsson 2010-03-29 02:53:58 +00:00
parent 383f4cc8b9
commit 800ded68b5
1 changed files with 3 additions and 2 deletions

View File

@ -1803,8 +1803,9 @@ VtableBuilder::AddMethods(BaseSubobject Base, uint64_t BaseOffsetInLayoutClass,
ComputeThisAdjustment(OverriddenMD, BaseOffsetInLayoutClass,
Overrider);
if (ThisAdjustment.VCallOffsetOffset) {
// This is a virtual thunk, add it.
if (ThisAdjustment.VCallOffsetOffset &&
Overrider.Method->getParent() == MostDerivedClass) {
// This is a virtual thunk for the most derived class, add it.
AddThunk(Overrider.Method,
ThunkInfo(ThisAdjustment, ReturnAdjustment()));
}