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,
1090
1090
std::string NormalizedName = TT.normalize ();
1091
1091
1092
1092
// 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) {
1095
1096
Diag (clang::diag::warn_drv_omp_offload_target_duplicate)
1096
- << Val << Duplicate ->second ;
1097
+ << Val << TripleIt ->second ;
1097
1098
continue ;
1098
1099
}
1099
1100
1100
- // Store the current triple so that we can check for duplicates in the
1101
- // following iterations.
1102
- FoundNormalizedTriples[NormalizedName] = Val;
1103
-
1104
1101
// If the specified target is invalid, emit a diagnostic.
1105
1102
if (TT.getArch () == llvm::Triple::UnknownArch) {
1106
1103
Diag (clang::diag::err_drv_invalid_omp_target) << Val;
You can’t perform that action at this time.
0 commit comments