[PATCH] D34489: [scan-build-py] Patch to fix "-analyzer-config" option

Haowei Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 21 16:57:24 PDT 2017


haowei created this revision.
Herald added a subscriber: whisperity.

I noticed that when I use "-analyze-config" option in scan-build-py, it behaves differently from original perl based scan-build.

For example, command:

$ scan-build -analyzer-config ipa=basic-inlining make

Will work without any issues on perl version of scan-build. But on scan-build-py it will throw an error message "error reading 'ipa=basic-inlining'". 
After debugging, it turns out that the scan-build-py does not put "-analyzer-config" flag in front of the analyzer config flags (in this case is the "ipa=basic-inlining") in the final clang command line. This patch fixes this issue.


https://reviews.llvm.org/D34489

Files:
  tools/scan-build-py/libscanbuild/analyze.py


Index: tools/scan-build-py/libscanbuild/analyze.py
===================================================================
--- tools/scan-build-py/libscanbuild/analyze.py
+++ tools/scan-build-py/libscanbuild/analyze.py
@@ -249,7 +249,7 @@
     if args.output_format:
         result.append('-analyzer-output={0}'.format(args.output_format))
     if args.analyzer_config:
-        result.append(args.analyzer_config)
+        result.extend(['-analyzer-config', args.analyzer_config])
     if args.verbose >= 4:
         result.append('-analyzer-display-progress')
     if args.plugins:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34489.103490.patch
Type: text/x-patch
Size: 581 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170621/635bb893/attachment.bin>


More information about the cfe-commits mailing list