Skip to content

Commit

Permalink
[Driver][SYCL][NFC] Fix memory sanitizer issue for AOT (#16063)
Browse files Browse the repository at this point in the history
When using AOT for GPU, we will setup implied options for PVC targets.
The strings that are formed need to be added to the vector to be
processed later. One of these strings was a StringRef so the pointed to
location can go away. Make a copy of the string to satisfy the
sanitizer.
  • Loading branch information
mdtoguchi authored Nov 13, 2024
1 parent 337aa79 commit 20471ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/lib/Driver/ToolChains/SYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1889,8 +1889,8 @@ void SYCLToolChain::AddImpliedTargetArgs(const llvm::Triple &Triple,
DeviceName = DevArg;
StringRef BackendOptName = SYCL::gen::getGenGRFFlag("auto");
if (IsGen)
PerDeviceArgs.push_back(
{DeviceName, Args.MakeArgString(BackendOptName)});
PerDeviceArgs.push_back({Args.MakeArgString(DeviceName),
Args.MakeArgString(BackendOptName)});
else if (IsJIT)
BeArgs.push_back(Args.MakeArgString(RegAllocModeOptName + DeviceName +
":" + BackendOptName));
Expand Down

0 comments on commit 20471ae

Please sign in to comment.