r190164 - [analyzer] SATestBuild: strip trailing newlines from command file.

Jordan Rose jordan_rose at apple.com
Fri Sep 6 09:12:41 PDT 2013


Author: jrose
Date: Fri Sep  6 11:12:41 2013
New Revision: 190164

URL: http://llvm.org/viewvc/llvm-project?rev=190164&view=rev
Log:
[analyzer] SATestBuild: strip trailing newlines from command file.

When running a make-based command, SATestBuild tries to append a -jN flag
with an appropriate N to run the build in parallel. However, it failed
to take into account that each line read includes a trailing newline
(unless it is the last line of a file without a trailing newline), which
resulted in the "-jN" appearing on a line on its own.

Modified:
    cfe/trunk/utils/analyzer/SATestBuild.py

Modified: cfe/trunk/utils/analyzer/SATestBuild.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/analyzer/SATestBuild.py?rev=190164&r1=190163&r2=190164&view=diff
==============================================================================
--- cfe/trunk/utils/analyzer/SATestBuild.py (original)
+++ cfe/trunk/utils/analyzer/SATestBuild.py Fri Sep  6 11:12:41 2013
@@ -215,6 +215,7 @@ def runScanBuild(Dir, SBOutputDir, PBuil
         SBCommandFile = open(BuildScriptPath, "r")
         SBPrefix = "scan-build " + SBOptions + " "
         for Command in SBCommandFile:
+            Command = Command.strip()
             # If using 'make', auto imply a -jX argument
             # to speed up analysis.  xcodebuild will
             # automatically use the maximum number of cores.





More information about the cfe-commits mailing list