llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: David Spickett (DavidSpickett)

<details>
<summary>Changes</summary>

If LLDB_PYTHON_DLL_RELATIVE_PATH is OFF, or it is ON and 
LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME is OFF, then GetModulePath is unused.
```
&lt;...&gt;/lldb/source/Host/windows/PythonRuntimeLoaderWindows.cpp(32,13): 
warning: unused function 'GetModulePath' [-Wunused-function]
   32 | std::string GetModulePath(HMODULE module) {
      |             ^~~~~~~~~~~~~
```

Rearrange the macros to define GetModulePath only if both options are enabled.

---
Full diff: https://github.com/llvm/llvm-project/pull/221173.diff


1 Files Affected:

- (modified) lldb/source/Host/windows/PythonRuntimeLoaderWindows.cpp (+5-3) 


``````````diff
diff --git a/lldb/source/Host/windows/PythonRuntimeLoaderWindows.cpp 
b/lldb/source/Host/windows/PythonRuntimeLoaderWindows.cpp
index 360a90ea81599..3f994daa92a0a 100644
--- a/lldb/source/Host/windows/PythonRuntimeLoaderWindows.cpp
+++ b/lldb/source/Host/windows/PythonRuntimeLoaderWindows.cpp
@@ -28,6 +28,8 @@ namespace lldb_private {
 
 namespace {
 
+#ifdef LLDB_PYTHON_DLL_RELATIVE_PATH
+#ifdef LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME
 /// Absolute path of \p module, or the running executable when null.
 std::string GetModulePath(HMODULE module) {
   std::vector<WCHAR> buffer(MAX_PATH);
@@ -46,8 +48,8 @@ std::string GetModulePath(HMODULE module) {
   }
   return "";
 }
+#endif // ifdef LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME
 
-#ifdef LLDB_PYTHON_DLL_RELATIVE_PATH
 std::string ExeRelativeCandidate() {
 #ifdef LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME
   std::string exe = GetModulePath(nullptr);
@@ -61,9 +63,9 @@ std::string ExeRelativeCandidate() {
   return std::string(path);
 #else
   return "";
-#endif
+#endif // ifdef LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME
 }
-#endif
+#endif // ifdef LLDB_PYTHON_DLL_RELATIVE_PATH
 
 } // namespace
 

``````````

</details>


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

Reply via email to