Skip to content

Commit 5803583

Browse files
authored
Merge pull request #85899 from compnerd/filename
DriverTool: adjust `argv[0]` scanning for CAS
2 parents f8f107f + 070916f commit 5803583

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/DriverTool/swift_cache_tool_main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ class SwiftCacheToolInvocation {
196196
}
197197
// drop swift-frontend executable path and leading `-frontend` from
198198
// command-line.
199-
if (StringRef(FrontendArgs[0]).ends_with("swift-frontend"))
199+
llvm::SmallString<261> path;
200+
llvm::sys::path::native(Twine{FrontendArgs[0]}, path);
201+
if (llvm::sys::path::filename(path).starts_with("swift-frontend"))
200202
FrontendArgs.erase(FrontendArgs.begin());
201203
if (StringRef(FrontendArgs[0]) == "-frontend")
202204
FrontendArgs.erase(FrontendArgs.begin());

0 commit comments

Comments
 (0)