@@ -561,6 +561,9 @@ addSYCLDeviceSanitizerLibs(const Compilation &C, bool IsSpirvAOT,
561561}
562562#endif
563563
564+ // Get the list of SYCL device libraries to link with user's device image if
565+ // some deprecated options are used including: -f[no-]sycl-device-lib=xxx,
566+ // -f[no-]sycl-device-lib-jit-link.
564567// TODO: remove getDeviceLibrariesLegacy when we remove deprecated options
565568// related to sycl device library link.
566569static SmallVector<std::string, 8 >
@@ -742,6 +745,7 @@ getDeviceLibrariesLegacy(const Compilation &C, const llvm::Triple &TargetTriple,
742745 return LibraryList;
743746}
744747
748+ // Get the list of SYCL device libraries to link with user's device image.
745749SmallVector<std::string, 8 >
746750SYCL::getDeviceLibraries (const Compilation &C, const llvm::Triple &TargetTriple,
747751 bool IsSpirvAOT) {
@@ -776,7 +780,7 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
776780 return LibraryList;
777781 }
778782
779- using SYCLDeviceLibsList = SmallVector<StringRef, 8 >;
783+ using SYCLDeviceLibsList = SmallVector<StringRef>;
780784 const SYCLDeviceLibsList SYCLDeviceLibs = {" libsycl-crt" ,
781785 " libsycl-complex" ,
782786 " libsycl-complex-fp64" ,
@@ -806,9 +810,7 @@ SYCL::getDeviceLibraries(const Compilation &C, const llvm::Triple &TargetTriple,
806810 LibSuffix = IsWindowsMSVCEnv ? " .new.obj" : " .new.o" ;
807811 auto addLibraries = [&](const SYCLDeviceLibsList &LibsList) {
808812 for (const StringRef &Lib : LibsList) {
809- SmallString<128 > LibName (Lib);
810- llvm::sys::path::replace_extension (LibName, LibSuffix);
811- LibraryList.push_back (Args.MakeArgString (LibName));
813+ LibraryList.push_back (Args.MakeArgString (Twine (Lib) + LibSuffix));
812814 }
813815 };
814816
0 commit comments