[Lldb-commits] [lldb] Remove python helper getCompilerBinary() (PR #100660)

via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 25 15:06:33 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Kendal Harland (kendalharland)

<details>
<summary>Changes</summary>

This causes a number of tests be `UNRESOLVED` on Windows if `getCompiler()` has a space in the name, because `getCompilerBinary()` unconditionally splits on whitespace and returns the first result, which might just be`"C:\Program"` if using a compiler such as `clang-cl` `cl` from Visual studio's installation directory.

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


1 Files Affected:

- (modified) lldb/packages/Python/lldbsuite/test/lldbplatformutil.py (+1-6) 


``````````diff
diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
index e3c6fd1a99568..0bbe1db424630 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
@@ -266,16 +266,11 @@ def getCompiler():
     return module.getCompiler()
 
 
-def getCompilerBinary():
-    """Returns the compiler binary the test suite is running with."""
-    return getCompiler().split()[0]
-
-
 def getCompilerVersion():
     """Returns a string that represents the compiler version.
     Supports: llvm, clang.
     """
-    compiler = getCompilerBinary()
+    compiler = getCompiler()
     version_output = subprocess.check_output([compiler, "--version"], errors="replace")
     m = re.search("version ([0-9.]+)", version_output)
     if m:

``````````

</details>


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


More information about the lldb-commits mailing list