================
@@ -117,11 +117,16 @@ bool ShouldUseNativeReaderByDefault() {
         !env_value.equals_insensitive("1") &&
         !env_value.equals_insensitive("true"))
       g_use_native_by_default = false;
+
+#if !LLVM_ENABLE_DIA_SDK || !defined(_WIN32)
+    // if the environment value is unset, the native reader is requested
+    if (env_value.empty())
+      g_use_native_by_default = true;
+#endif
----------------
Michael137 wrote:

I think this function would be clearer if we rewrote it using an 
immediately-invoked-lambda:
```
static bool g_use_native_by_default = [] {
  llvm::StringRef env_value = ::getenv("LLDB_USE_NATIVE_PDB_READER");
#if !LLVM_ENABLE_DIA_SDK || !defined(_WIN32)
    // if the environment value is unset, the native reader is requested
    if (env_value.empty())
      return true;
#endif

  ...
}();
```

https://github.com/llvm/llvm-project/pull/160067
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to