mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-18 13:56:07 +00:00
Get rid of 'this' adjustments from the FinalOverriders class since they can be different for the same overrider in different parts of the vtable.
llvm-svn: 97068
This commit is contained in:
parent
d8d698da60
commit
3c1ec97a28
@ -98,10 +98,6 @@ private:
|
|||||||
/// need to perform return value adjustments.
|
/// need to perform return value adjustments.
|
||||||
AdjustmentOffsetsMapTy ReturnAdjustments;
|
AdjustmentOffsetsMapTy ReturnAdjustments;
|
||||||
|
|
||||||
/// ThisAdjustments - Holds 'this' adjustments for all the overriders that
|
|
||||||
/// need them.
|
|
||||||
AdjustmentOffsetsMapTy ThisAdjustments;
|
|
||||||
|
|
||||||
typedef llvm::SmallVector<uint64_t, 1> OffsetVectorTy;
|
typedef llvm::SmallVector<uint64_t, 1> OffsetVectorTy;
|
||||||
|
|
||||||
/// SubobjectOffsetsMapTy - This map is used for keeping track of all the
|
/// SubobjectOffsetsMapTy - This map is used for keeping track of all the
|
||||||
@ -174,14 +170,6 @@ public:
|
|||||||
return ReturnAdjustments.lookup(std::make_pair(Base, MD));
|
return ReturnAdjustments.lookup(std::make_pair(Base, MD));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getThisAdjustmentOffset - Get the 'this' pointer adjustment offset for the
|
|
||||||
/// method decl in the given base subobject. Returns an empty base offset if
|
|
||||||
/// no adjustment is needed.
|
|
||||||
BaseOffset getThisAdjustmentOffset(BaseSubobject Base,
|
|
||||||
const CXXMethodDecl *MD) const {
|
|
||||||
return ThisAdjustments.lookup(std::make_pair(Base, MD));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// dump - dump the final overriders.
|
/// dump - dump the final overriders.
|
||||||
void dump() {
|
void dump() {
|
||||||
assert(VisitedVirtualBases.empty() &&
|
assert(VisitedVirtualBases.empty() &&
|
||||||
@ -450,17 +438,6 @@ void FinalOverriders::PropagateOverrider(const CXXMethodDecl *OldMD,
|
|||||||
// Store the return adjustment base offset.
|
// Store the return adjustment base offset.
|
||||||
ReturnAdjustments[SubobjectAndMethod] = ReturnBaseOffset;
|
ReturnAdjustments[SubobjectAndMethod] = ReturnBaseOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if we need a 'this' adjustment base offset as well.
|
|
||||||
if (Offset != NewBase.getBaseOffset()) {
|
|
||||||
BaseOffset ThisBaseOffset =
|
|
||||||
ComputeThisAdjustmentBaseOffset(OverriddenSubobject,
|
|
||||||
NewBase);
|
|
||||||
assert(!ThisBaseOffset.isEmpty() &&
|
|
||||||
"Should not get an empty 'this' adjustment!");
|
|
||||||
|
|
||||||
ThisAdjustments[SubobjectAndMethod] = ThisBaseOffset;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the new overrider.
|
// Set the new overrider.
|
||||||
@ -639,17 +616,6 @@ void FinalOverriders::dump(llvm::raw_ostream &Out, BaseSubobject Base) {
|
|||||||
Out << Offset.NonVirtualOffset << " nv]";
|
Out << Offset.NonVirtualOffset << " nv]";
|
||||||
}
|
}
|
||||||
|
|
||||||
AI = ThisAdjustments.find(std::make_pair(Base, MD));
|
|
||||||
if (AI != ThisAdjustments.end()) {
|
|
||||||
const BaseOffset &Offset = AI->second;
|
|
||||||
|
|
||||||
Out << " [this-adj: ";
|
|
||||||
if (Offset.VirtualBase)
|
|
||||||
Out << Offset.VirtualBase->getQualifiedNameAsString() << " vbase, ";
|
|
||||||
|
|
||||||
Out << Offset.NonVirtualOffset << " nv]";
|
|
||||||
}
|
|
||||||
|
|
||||||
Out << "\n";
|
Out << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user