]> granicus.if.org Git - clang/commitdiff
[analyzer] SATestBuild: strip trailing newlines from command file.
authorJordan Rose <jordan_rose@apple.com>
Fri, 6 Sep 2013 16:12:41 +0000 (16:12 +0000)
committerJordan Rose <jordan_rose@apple.com>
Fri, 6 Sep 2013 16:12:41 +0000 (16:12 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190164 91177308-0d34-0410-b5e6-96231b3b80d8

utils/analyzer/SATestBuild.py

index eb7796431a18b3c5fe4ed0577eb08fe87baff980..51bc6e25937804432494bf08f3cff3bded88126c 100755 (executable)
@@ -215,6 +215,7 @@ def runScanBuild(Dir, SBOutputDir, PBuildLogFile):
         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.