Skip to content

Commit 8997f7e

Browse files
authored
Merge pull request #63280 from apple/compnerd/target-info
DependencyScan: change commandline processing style
2 parents c3693f2 + deb3f9c commit 8997f7e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/DependencyScan/DependencyScanningTool.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ llvm::ErrorOr<swiftscan_string_ref_t> getTargetInfo(ArrayRef<const char *> Comma
4242
SmallVector<const char *, 4> Args;
4343
llvm::BumpPtrAllocator Alloc;
4444
llvm::StringSaver Saver(Alloc);
45-
llvm::cl::TokenizeGNUCommandLine(CommandString, Saver, Args);
45+
// Ensure that we use the Windows command line parsing on Windows as we need
46+
// to ensure that we properly handle paths.
47+
if (llvm::Triple(llvm::sys::getProcessTriple()).isOSWindows())
48+
llvm::cl::TokenizeWindowsCommandLine(CommandString, Saver, Args);
49+
else
50+
llvm::cl::TokenizeGNUCommandLine(CommandString, Saver, Args);
4651
SourceManager dummySM;
4752
DiagnosticEngine DE(dummySM);
4853
CompilerInvocation Invocation;

0 commit comments

Comments
 (0)