File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1090,17 +1090,14 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
10901090 std::string NormalizedName = TT.normalize ();
10911091
10921092 // Make sure we don't have a duplicate triple.
1093- auto Duplicate = FoundNormalizedTriples.find (NormalizedName);
1094- if (Duplicate != FoundNormalizedTriples.end ()) {
1093+ auto [TripleIt, Inserted] =
1094+ FoundNormalizedTriples.try_emplace (NormalizedName, Val);
1095+ if (!Inserted) {
10951096 Diag (clang::diag::warn_drv_omp_offload_target_duplicate)
1096- << Val << Duplicate ->second ;
1097+ << Val << TripleIt ->second ;
10971098 continue ;
10981099 }
10991100
1100- // Store the current triple so that we can check for duplicates in the
1101- // following iterations.
1102- FoundNormalizedTriples[NormalizedName] = Val;
1103-
11041101 // If the specified target is invalid, emit a diagnostic.
11051102 if (TT.getArch () == llvm::Triple::UnknownArch) {
11061103 Diag (clang::diag::err_drv_invalid_omp_target) << Val;
You can’t perform that action at this time.
0 commit comments