[clang] Prefer clang_setup over use_clang

This patch switches over uses of use_clang to clang_setup to fix a
potential race condition that has been impacting CI.

This is split from the refactoring to ensure I'm not missing anything
major here on the clang-tools-extra side.

This should fix #145703.

Reviewers: AaronBallman, HighCommander4, HerrCai0907, petrhosek, Keenuts

Reviewed By: petrhosek

Pull Request: https://github.com/llvm/llvm-project/pull/147437
This commit is contained in:
Aiden Grossman 2025-07-10 06:14:06 -07:00 committed by GitHub
parent cd474bb801
commit 896575eb74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
import lit.llvm
lit.llvm.initialize(lit_config, config)
lit.llvm.llvm_config.use_clang([], [], required=False)
lit.llvm.llvm_config.clang_setup()
lit.llvm.llvm_config.use_default_substitutions()
config.name = "Clangd"

View File

@ -42,7 +42,7 @@ config.test_source_root = os.path.dirname(__file__)
config.test_exec_root = os.path.join(config.clang_tools_binary_dir, "test")
# Tools need the same environment setup as clang (we don't need clang itself).
llvm_config.use_clang(required=False)
llvm_config.clang_setup()
if config.clang_tidy_staticanalyzer:
config.available_features.add("static-analyzer")