@@ -32,7 +32,7 @@ ValueTypeByHwMode::ValueTypeByHwMode(const Record *R,
3232 const CodeGenHwModes &CGH) {
3333 const HwModeSelect &MS = CGH.getHwModeSelect (R);
3434 for (const HwModeSelect::PairType &P : MS.Items ) {
35- auto I = Map.insert ({ P.first , MVT (llvm::getValueType (P.second ))} );
35+ auto I = Map.try_emplace ( P.first , MVT (llvm::getValueType (P.second )));
3636 assert (I.second && " Duplicate entry?" );
3737 (void )I;
3838 }
@@ -142,7 +142,7 @@ RegSizeInfoByHwMode::RegSizeInfoByHwMode(const Record *R,
142142 const CodeGenHwModes &CGH) {
143143 const HwModeSelect &MS = CGH.getHwModeSelect (R);
144144 for (const HwModeSelect::PairType &P : MS.Items ) {
145- auto I = Map.insert ({ P.first , RegSizeInfo (P.second )} );
145+ auto I = Map.try_emplace ( P.first , RegSizeInfo (P.second ));
146146 assert (I.second && " Duplicate entry?" );
147147 (void )I;
148148 }
@@ -195,7 +195,7 @@ SubRegRangeByHwMode::SubRegRangeByHwMode(const Record *R,
195195 const CodeGenHwModes &CGH) {
196196 const HwModeSelect &MS = CGH.getHwModeSelect (R);
197197 for (const HwModeSelect::PairType &P : MS.Items ) {
198- auto I = Map.insert ({ P.first , SubRegRange (P.second )} );
198+ auto I = Map.try_emplace ( P.first , SubRegRange (P.second ));
199199 assert (I.second && " Duplicate entry?" );
200200 (void )I;
201201 }
@@ -207,7 +207,7 @@ EncodingInfoByHwMode::EncodingInfoByHwMode(const Record *R,
207207 for (const HwModeSelect::PairType &P : MS.Items ) {
208208 assert (P.second && P.second ->isSubClassOf (" InstructionEncoding" ) &&
209209 " Encoding must subclass InstructionEncoding" );
210- auto I = Map.insert ({ P.first , P.second } );
210+ auto I = Map.try_emplace ( P.first , P.second );
211211 assert (I.second && " Duplicate entry?" );
212212 (void )I;
213213 }
0 commit comments