================
@@ -57,9 +59,12 @@ Error SpecialCaseList::Matcher::insert(StringRef Pattern, 
unsigned LineNumber,
   auto Glob = std::make_unique<Matcher::Glob>();
   Glob->Name = Pattern.str();
   Glob->LineNo = LineNumber;
+  // Backslashes are valid in posix-style filenames.
+  bool IsSlashAgnostic = Triple(sys::getDefaultTargetTriple()).isOSWindows();
----------------
jyknight wrote:

Because we're talking about source files being read by the compiler, the 
interpretation of paths should be based on whether the compiler is built for 
and running on windows -- not based on what target the compiler defaults to 
build code for. 

You could detect that with `#ifdef _WIN32`. But even better is to use the 
abstraction `llvm::sys::path::is_style_windows(llvm::sys::path::native)`, which 
does the same, but in a more self-documenting manner.

https://github.com/llvm/llvm-project/pull/149886
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to