[llvm] r374815 - [clang-scan-deps] Support for clang --analyze in clang-scan-deps

Jan Korous via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 13:15:02 PDT 2019


Author: jkorous
Date: Mon Oct 14 13:15:01 2019
New Revision: 374815

URL: http://llvm.org/viewvc/llvm-project?rev=374815&view=rev
Log:
[clang-scan-deps] Support for clang --analyze in clang-scan-deps

The goal is to have 100% fidelity in clang-scan-deps behavior when
--analyze is present in compilation command.

At the same time I don't want to break clang-tidy which expects
__static_analyzer__ macro defined as built-in.

I introduce new cc1 options (-setup-static-analyzer) that controls
the macro definition and is conditionally set in driver.

Differential Revision: https://reviews.llvm.org/D68093

Modified:
    llvm/trunk/utils/lit/lit/llvm/config.py

Modified: llvm/trunk/utils/lit/lit/llvm/config.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/llvm/config.py?rev=374815&r1=374814&r2=374815&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/llvm/config.py (original)
+++ llvm/trunk/utils/lit/lit/llvm/config.py Mon Oct 14 13:15:01 2019
@@ -402,7 +402,7 @@ class LLVMConfig(object):
         builtin_include_dir = self.get_clang_builtin_include_dir(self.config.clang)
         tool_substitutions = [
             ToolSubst('%clang', command=self.config.clang, extra_args=additional_flags),
-            ToolSubst('%clang_analyze_cc1', command='%clang_cc1', extra_args=['-analyze', '%analyze']+additional_flags),
+            ToolSubst('%clang_analyze_cc1', command='%clang_cc1', extra_args=['-analyze', '%analyze', '-setup-static-analyzer']+additional_flags),
             ToolSubst('%clang_cc1', command=self.config.clang, extra_args=['-cc1', '-internal-isystem', builtin_include_dir, '-nostdsysteminc']+additional_flags),
             ToolSubst('%clang_cpp', command=self.config.clang, extra_args=['--driver-mode=cpp']+additional_flags),
             ToolSubst('%clang_cl', command=self.config.clang, extra_args=['--driver-mode=cl']+additional_flags),




More information about the llvm-commits mailing list