Skip to content

[Driver][NFC] Fix string problem used for tracking duplicate triples #1424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,
Arg *SYCLTargetsValues = SYCLTargets ? SYCLTargets : SYCLLinkTargets;
if (SYCLTargetsValues) {
if (SYCLTargetsValues->getNumValues()) {
for (const char *Val : SYCLTargetsValues->getValues()) {
for (StringRef Val : SYCLTargetsValues->getValues()) {
llvm::Triple TT(Val);
if (!isValidSYCLTriple(TT)) {
Diag(clang::diag::err_drv_invalid_sycl_target) << Val;
Expand All @@ -821,7 +821,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,

// Store the current triple so that we can check for duplicates in
// the following iterations.
FoundNormalizedTriples[NormalizedName] = NormalizedName;
FoundNormalizedTriples[NormalizedName] = Val;
UniqueSYCLTriplesVec.push_back(TT);
}
} else
Expand Down Expand Up @@ -857,7 +857,7 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C,

// Store the current triple so that we can check for duplicates in
// the following iterations.
FoundNormalizedTriples[NormalizedName] = NormalizedName;
FoundNormalizedTriples[NormalizedName] = Val;
UniqueSYCLTriplesVec.push_back(TT);
} else {
// No colon found, do not use the input
Expand Down