[PATCH] D61418: Another attempt to fix "could not find clang-check" lit warning in analyzer-less builds

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 1 18:55:59 PDT 2019


thakis created this revision.
thakis added a reviewer: rnk.
Herald added subscribers: dkrupp, donat.nagy, Szelethus, a.sidorin, baloghadamsoftware.

r359717 added clang-check as a dep of check-clang unconditionally because I had missed lit.local.cfg in test/Tooling.

Instead, only add clang-check to the tools if the analyzer is enabled, since the build target only exists then, and since all tests using clang-check are skipped when the analyzer is disabled.


https://reviews.llvm.org/D61418

Files:
  clang/test/lit.cfg.py


Index: clang/test/lit.cfg.py
===================================================================
--- clang/test/lit.cfg.py
+++ clang/test/lit.cfg.py
@@ -61,8 +61,7 @@
 tool_dirs = [config.clang_tools_dir, config.llvm_tools_dir]
 
 tools = [
-    'c-index-test', 'clang-check', 'clang-diff', 'clang-format', 'clang-tblgen',
-    'opt',
+    'c-index-test', 'clang-diff', 'clang-format', 'clang-tblgen', 'opt',
     ToolSubst('%clang_extdef_map', command=FindTool(
         'clang-extdef-mapping'), unresolved='ignore'),
 ]
@@ -71,6 +70,14 @@
     config.available_features.add('examples')
     tools.append('clang-interpreter')
 
+if config.clang_staticanalyzer:
+    config.available_features.add('staticanalyzer')
+    tools.append('clang-check')
+
+    if config.clang_staticanalyzer_z3 == '1':
+        config.available_features.add('z3')
+
+
 llvm_config.add_tool_substitutions(tools, tool_dirs)
 
 config.substitutions.append(
@@ -92,13 +99,6 @@
 if config.clang_default_cxx_stdlib != '':
     config.available_features.add('default-cxx-stdlib-set')
 
-# Enabled/disabled features
-if config.clang_staticanalyzer:
-    config.available_features.add('staticanalyzer')
-
-    if config.clang_staticanalyzer_z3 == '1':
-        config.available_features.add('z3')
-
 # As of 2011.08, crash-recovery tests still do not pass on FreeBSD.
 if platform.system() not in ['FreeBSD']:
     config.available_features.add('crash-recovery')


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61418.197690.patch
Type: text/x-patch
Size: 1432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190502/d713455a/attachment-0001.bin>


More information about the cfe-commits mailing list