Skip to content

Commit 3671d93

Browse files
committed
Look for amd-llvm-spirv instead of llvm-spirv
Instead of llvm-spirv we look for the amd-llvm-spirv, which is our ephemeral, temporary build of the translator that nests changes that are not in upstream. This will be removed in the future. Change-Id: I71854425277a62441148e03ab46af3d241c0ad07
1 parent f03c9f7 commit 3671d93

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

clang/lib/Driver/ToolChains/SPIRV.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@ void SPIRV::constructTranslateCommand(Compilation &C, const Tool &T,
3535

3636
// Try to find "llvm-spirv-<LLVM_VERSION_MAJOR>". Otherwise, fall back to
3737
// plain "llvm-spirv".
38+
// AMD FORK ONLY: instead of llvm-spirv we look for the amd-llvm-spirv, which
39+
// is our ephemeral, temporary build of the translator that nests changes that
40+
// are not in upstream. This will be removed in the future.
3841
using namespace std::string_literals;
3942
auto VersionedTool = "llvm-spirv-"s + std::to_string(LLVM_VERSION_MAJOR);
43+
if (T.getToolChain().getTriple().getVendor() == llvm::Triple::VendorType::AMD)
44+
VersionedTool.insert(0, "amd-");
4045
std::string ExeCand = T.getToolChain().GetProgramPath(VersionedTool.c_str());
4146
if (!llvm::sys::fs::can_execute(ExeCand))
42-
ExeCand = T.getToolChain().GetProgramPath("llvm-spirv");
47+
ExeCand = T.getToolChain().GetProgramPath(
48+
VersionedTool.substr(0, VersionedTool.find_last_of('-')).c_str());
4349

4450
const char *Exec = C.getArgs().MakeArgString(ExeCand);
4551
C.addCommand(std::make_unique<Command>(JA, T, ResponseFileSupport::None(),

0 commit comments

Comments
 (0)