[llvm] [Support] Support runtime override for LLVM_WINDOWS_PREFER_FORWARD_SLASH (PR #199210)

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Fri May 22 07:17:47 PDT 2026


================
@@ -38,13 +38,29 @@ namespace {
   using llvm::sys::path::is_separator;
   using llvm::sys::path::Style;
 
+  inline bool prefer_forward_slash() {
+    static bool prefer = []() {
+      if (std::optional<std::string> Env =
+              sys::Process::GetEnv("LLVM_WINDOWS_PREFER_FORWARD_SLASH")) {
+        StringRef Ref(*Env);
+        if (Ref.empty() || Ref.equals_insensitive("0") ||
----------------
rnk wrote:

Return the negated Boolean, rather than the two return statements 

https://github.com/llvm/llvm-project/pull/199210


More information about the llvm-commits mailing list