[Lldb-commits] [lldb] [lldb][test] Assume clang supports -gmodules (PR #201333)

via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 3 04:56:45 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Raphael Isemann (Teemperor)

<details>
<summary>Changes</summary>

We currently spend 50ms in most dotest invocations to check if clang supports `-gmodules`. The expensive part of this check is creating the clang process to run `clang --help`.

`-gmodules` was added 11 years ago and is present in any compiler that has even a remote chance in supporting the rest of our test suite. This patch just assumes that our compiler supports -gmodules if it is clang.

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


1 Files Affected:

- (modified) lldb/packages/Python/lldbsuite/support/gmodules.py (+1-6) 


``````````diff
diff --git a/lldb/packages/Python/lldbsuite/support/gmodules.py b/lldb/packages/Python/lldbsuite/support/gmodules.py
index 81185a5642266..00a01aebb909e 100644
--- a/lldb/packages/Python/lldbsuite/support/gmodules.py
+++ b/lldb/packages/Python/lldbsuite/support/gmodules.py
@@ -14,12 +14,7 @@ def is_compiler_clang_with_gmodules(compiler_path):
 
     def _gmodules_supported_internal():
         compiler = os.path.basename(compiler_path)
-        if "clang" not in compiler:
-            return False
-        else:
-            # Check the compiler help for the -gmodules option.
-            clang_help = os.popen("%s --help" % compiler_path).read()
-            return GMODULES_HELP_REGEX.search(clang_help, re.DOTALL) is not None
+        return "clang" in compiler
 
     GMODULES_SUPPORT_MAP[compiler_path] = _gmodules_supported_internal()
     return GMODULES_SUPPORT_MAP[compiler_path]

``````````

</details>


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


More information about the lldb-commits mailing list