File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -1169,12 +1169,13 @@ void ItaniumVTableBuilder::ComputeThisAdjustments() {
1169
1169
//
1170
1170
// Do not set ThunkInfo::Method if Idx is already in VTableThunks. This
1171
1171
// can happen when covariant return adjustment is required too.
1172
- if (!VTableThunks.count (Idx)) {
1172
+ auto [It, Inserted] = VTableThunks.try_emplace (Idx);
1173
+ if (Inserted) {
1173
1174
const CXXMethodDecl *Method = VTables.findOriginalMethodInMap (MD);
1174
- VTableThunks[Idx] .Method = Method;
1175
- VTableThunks[Idx] .ThisType = Method->getThisType ().getTypePtr ();
1175
+ It-> second .Method = Method;
1176
+ It-> second .ThisType = Method->getThisType ().getTypePtr ();
1176
1177
}
1177
- VTableThunks[Idx] .This = ThisAdjustment;
1178
+ It-> second .This = ThisAdjustment;
1178
1179
};
1179
1180
1180
1181
SetThisAdjustmentThunk (VTableIndex);
@@ -1653,8 +1654,9 @@ void ItaniumVTableBuilder::AddMethods(
1653
1654
// findOriginalMethod to find the method that created the entry if the
1654
1655
// method in the entry requires adjustment.
1655
1656
if (!ReturnAdjustment.isEmpty ()) {
1656
- VTableThunks[Components.size ()].Method = MD;
1657
- VTableThunks[Components.size ()].ThisType = MD->getThisType ().getTypePtr ();
1657
+ auto &VTT = VTableThunks[Components.size ()];
1658
+ VTT.Method = MD;
1659
+ VTT.ThisType = MD->getThisType ().getTypePtr ();
1658
1660
}
1659
1661
1660
1662
AddMethod (Overrider.Method , ReturnAdjustment);
You can’t perform that action at this time.
0 commit comments