Skip to content

Commit

Permalink
[scan-build-py] Patch to fix "-analyzer-config" option
Browse files Browse the repository at this point in the history
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.

Patch by Haowei Wu

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

llvm-svn: 308401
  • Loading branch information
petrhosek committed Jul 19, 2017
1 parent 5649b0e commit 5518d18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/tools/scan-build-py/libscanbuild/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def prefix_with(constant, pieces):
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:
Expand Down

0 comments on commit 5518d18

Please sign in to comment.