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() {
11691169 //
11701170 // Do not set ThunkInfo::Method if Idx is already in VTableThunks. This
11711171 // 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) {
11731174 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 ();
11761177 }
1177- VTableThunks[Idx] .This = ThisAdjustment;
1178+ It-> second .This = ThisAdjustment;
11781179 };
11791180
11801181 SetThisAdjustmentThunk (VTableIndex);
@@ -1653,8 +1654,9 @@ void ItaniumVTableBuilder::AddMethods(
16531654 // findOriginalMethod to find the method that created the entry if the
16541655 // method in the entry requires adjustment.
16551656 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 ();
16581660 }
16591661
16601662 AddMethod (Overrider.Method , ReturnAdjustment);
You can’t perform that action at this time.
0 commit comments