[Lldb-commits] [lldb] baccad7 - [lldb][test] Assume clang supports -gmodules (#201333)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Jun 5 00:58:09 PDT 2026
Author: Raphael Isemann
Date: 2026-06-05T08:58:05+01:00
New Revision: baccad7b70143154bf978b00d3a8bed9a03db84a
URL: https://github.com/llvm/llvm-project/commit/baccad7b70143154bf978b00d3a8bed9a03db84a
DIFF: https://github.com/llvm/llvm-project/commit/baccad7b70143154bf978b00d3a8bed9a03db84a.diff
LOG: [lldb][test] Assume clang supports -gmodules (#201333)
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.
Added:
Modified:
lldb/packages/Python/lldbsuite/support/gmodules.py
Removed:
################################################################################
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]
More information about the lldb-commits
mailing list