tianshilei1992 added inline comments.
================ Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:1695 - std::string LibOmpTargetName = - "libomptarget-" + BitcodeSuffix.str() + ".bc"; - - for (StringRef LibraryPath : LibraryPaths) { - SmallString<128> LibOmpTargetFile(LibraryPath); - llvm::sys::path::append(LibOmpTargetFile, LibOmpTargetName); - if (llvm::sys::fs::exists(LibOmpTargetFile)) { - CC1Args.push_back("-mlink-builtin-bitcode"); - CC1Args.push_back(DriverArgs.MakeArgString(LibOmpTargetFile)); - FoundBCLibrary = true; - break; + llvm::Twine LibOmpTargetName = "libomptarget-" + BitcodeSuffix + ".bc"; + llvm::Twine FallbackTargetName = ---------------- If you're using `Twine`, `+` is not needed. ``` llvm::Twine LibOmpTargetName("libomptarget-", BitcodeSuffix ,".bc"); ``` ================ Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:1697 + llvm::Twine FallbackTargetName = + "libomptarget-" + ArchPrefix + "-unknown.bc"; + ---------------- The `BitcodeSuffix` for NVPTX consists of three parts: `nvptx`, `cuda_xxx`, and `sm_yy`. We might want to have an unknown for every `sm`? ================ Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:1699-1700 + + FoundBCLibrary = tryAppendBuiltinBitcodeGivenPaths( + LibraryPaths, DriverArgs, CC1Args, LibOmpTargetName); + ---------------- ``` bool FoundBCLibrary = tryAppendBuiltinBitcodeGivenPaths( LibraryPaths, DriverArgs, CC1Args, LibOmpTargetName); ``` Remove the definition above? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96877/new/ https://reviews.llvm.org/D96877 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits