Skip to content

Commit e38ded0

Browse files
committed
Fix documenetation error. Add TODO for --sycl-link usage. Add couple of changes missed out from earlier commit.
Signed-off-by: Arvind Sudarsanam <[email protected]>
1 parent 21a7b1c commit e38ded0

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

clang/docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Using Clang Tools
9797
ClangOffloadBundler
9898
ClangOffloadPackager
9999
ClangRepl
100-
ClangSYCLLinkWrapper
100+
ClangSYCLLinker
101101

102102
Design Documents
103103
================

clang/lib/Driver/ToolChains/SPIRV.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ void SPIRV::Linker::ConstructJob(Compilation &C, const JobAction &JA,
107107
SPIRVToolChain::SPIRVToolChain(const Driver &D, const llvm::Triple &Triple,
108108
const ArgList &Args)
109109
: ToolChain(D, Triple, Args) {
110+
// TODO: Revisit need/use of --sycl-link option once SYCL toolchain is
111+
// available and SYCL linking support is moved there.
110112
NativeLLVMSupport = Args.hasArg(options::OPT_sycl_link);
111113
}
112114

clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,11 @@ static void getSPIRVTransOpts(const ArgList &Args,
367367
static Expected<StringRef> runLLVMToSPIRVTranslation(StringRef File,
368368
const ArgList &Args) {
369369
llvm::TimeTraceScope TimeScope("LLVMToSPIRVTranslation");
370-
Expected<std::string> LLVMToSPIRVPath =
371-
findProgram(Args, "llvm-spirv", {getMainExecutable("llvm-spirv")});
372-
if (!LLVMToSPIRVPath)
373-
return LLVMToSPIRVPath.takeError();
370+
StringRef LLVMSPIRVPath = Args.getLastArgValue(llvm_spirv_path_EQ);
371+
Expected<std::string> LLVMToSPIRVProg =
372+
findProgram(Args, "llvm-spirv", {LLVMSPIRVPath});
373+
if (!LLVMToSPIRVProg)
374+
return LLVMToSPIRVProg.takeError();
374375

375376
SmallVector<StringRef, 8> CmdArgs;
376377
CmdArgs.push_back(*LLVMToSPIRVPath);
@@ -383,7 +384,7 @@ static Expected<StringRef> runLLVMToSPIRVTranslation(StringRef File,
383384
/* KeepEmpty = */ false);
384385
CmdArgs.append({"-o", OutputFile});
385386
CmdArgs.push_back(File);
386-
if (Error Err = executeCommands(*LLVMToSPIRVPath, CmdArgs))
387+
if (Error Err = executeCommands(*LLVMToSPIRVProg, CmdArgs))
387388
return std::move(Err);
388389

389390
if (!SPIRVDumpDir.empty()) {

0 commit comments

Comments
 (0)