vsavchenko created this revision.
vsavchenko added a reviewer: NoQ.
Herald added subscribers: cfe-commits, ASDenysPetrov, Charusso, dkrupp, 
donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, 
xazax.hun.
Herald added a project: clang.
NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.

Ideally we should be able to control it on per-project basis(?)


vsavchenko added a comment.

I agree, but I think we should refactor a bit how we process command line 
arguments before that.


It is good to have a way to control this behavior manually.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80211

Files:
  clang/utils/analyzer/SATestBuild.py


Index: clang/utils/analyzer/SATestBuild.py
===================================================================
--- clang/utils/analyzer/SATestBuild.py
+++ clang/utils/analyzer/SATestBuild.py
@@ -291,9 +291,9 @@
     SBOptions += "--keep-empty "
     SBOptions += "-analyzer-config '%s' " % generateAnalyzerConfig(Args)
 
-    # Always use ccc-analyze to ensure that we can locate the failures
-    # directory.
-    SBOptions += "--override-compiler "
+    if Args.override_compiler:
+        SBOptions += "--override-compiler "
+
     ExtraEnv = {}
     try:
         SBCommandFile = open(BuildScriptPath, "r")
@@ -800,11 +800,14 @@
                              reference. Default is 0.')
     Parser.add_argument('-r', dest='regenerate', action='store_true',
                         default=False, help='Regenerate reference output.')
+    Parser.add_argument('--override-compiler', action='store_true',
+                        default=False, help='Call scan-build with \
+                        --override-compiler option.')
     Parser.add_argument('-j', '--jobs', dest='jobs', type=int,
                         default=0,
                         help='Number of projects to test concurrently')
-    Parser.add_argument('--extra-analyzer-config', 
dest='extra_analyzer_config',
-                        type=str,
+    Parser.add_argument('--extra-analyzer-config',
+                        dest='extra_analyzer_config', type=str,
                         default="",
                         help="Arguments passed to to -analyzer-config")
     Args = Parser.parse_args()


Index: clang/utils/analyzer/SATestBuild.py
===================================================================
--- clang/utils/analyzer/SATestBuild.py
+++ clang/utils/analyzer/SATestBuild.py
@@ -291,9 +291,9 @@
     SBOptions += "--keep-empty "
     SBOptions += "-analyzer-config '%s' " % generateAnalyzerConfig(Args)
 
-    # Always use ccc-analyze to ensure that we can locate the failures
-    # directory.
-    SBOptions += "--override-compiler "
+    if Args.override_compiler:
+        SBOptions += "--override-compiler "
+
     ExtraEnv = {}
     try:
         SBCommandFile = open(BuildScriptPath, "r")
@@ -800,11 +800,14 @@
                              reference. Default is 0.')
     Parser.add_argument('-r', dest='regenerate', action='store_true',
                         default=False, help='Regenerate reference output.')
+    Parser.add_argument('--override-compiler', action='store_true',
+                        default=False, help='Call scan-build with \
+                        --override-compiler option.')
     Parser.add_argument('-j', '--jobs', dest='jobs', type=int,
                         default=0,
                         help='Number of projects to test concurrently')
-    Parser.add_argument('--extra-analyzer-config', dest='extra_analyzer_config',
-                        type=str,
+    Parser.add_argument('--extra-analyzer-config',
+                        dest='extra_analyzer_config', type=str,
                         default="",
                         help="Arguments passed to to -analyzer-config")
     Args = Parser.parse_args()
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D80211: [analyze... Valeriy Savchenko via Phabricator via cfe-commits

Reply via email to