diff options
author | Serge Guelton <sguelton@quarkslab.com> | 2018-12-18 08:36:33 +0000 |
---|---|---|
committer | Serge Guelton <sguelton@quarkslab.com> | 2018-12-18 08:36:33 +0000 |
commit | c0ebe773cd0fb301474430205c69440f9915d5b0 (patch) | |
tree | 15c98a08b79b0dddbfeea4f95372771ba44d4dd1 /clang/utils/analyzer/SumTimerInfo.py | |
parent | 85833393d0e588f6d7613567db9c212236e3f0eb (diff) | |
download | bcm5719-llvm-c0ebe773cd0fb301474430205c69440f9915d5b0.tar.gz bcm5719-llvm-c0ebe773cd0fb301474430205c69440f9915d5b0.zip |
Portable Python script across Python version
Using from __future__ import print_function it is possible to have a compatible behavior of `print(...)` across Python version.
Differential Revision: https://reviews.llvm.org/D55213
llvm-svn: 349454
Diffstat (limited to 'clang/utils/analyzer/SumTimerInfo.py')
-rw-r--r-- | clang/utils/analyzer/SumTimerInfo.py | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/clang/utils/analyzer/SumTimerInfo.py b/clang/utils/analyzer/SumTimerInfo.py index 50e1cb854f4..b3219b00c7b 100644 --- a/clang/utils/analyzer/SumTimerInfo.py +++ b/clang/utils/analyzer/SumTimerInfo.py @@ -6,13 +6,14 @@ Script to Summarize statistics in the scan-build output. Statistics are enabled by passing '-internal-stats' option to scan-build (or '-analyzer-stats' to the analyzer). """ +from __future__ import print_function import sys if __name__ == '__main__': if len(sys.argv) < 2: - print >> sys.stderr, 'Usage: ', sys.argv[0],\ - 'scan_build_output_file' + print('Usage: ', sys.argv[0],\ + 'scan_build_output_file', file=sys.stderr) sys.exit(-1) f = open(sys.argv[1], 'r') @@ -65,15 +66,15 @@ if __name__ == '__main__': s = line.split() TotalTime = TotalTime + float(s[6]) - print "TU Count %d" % (Count) - print "Time %f" % (Time) - print "Warnings %d" % (Warnings) - print "Functions Analyzed %d" % (FunctionsAnalyzed) - print "Reachable Blocks %d" % (ReachableBlocks) - print "Reached Max Steps %d" % (ReachedMaxSteps) - print "Number of Steps %d" % (NumSteps) - print "Number of Inlined calls %d (bifurcated %d)" % ( - NumInlinedCallSites, NumBifurcatedCallSites) - print "MaxTime %f" % (MaxTime) - print "TotalTime %f" % (TotalTime) - print "Max CFG Size %d" % (MaxCFGSize) + print("TU Count %d" % (Count)) + print("Time %f" % (Time)) + print("Warnings %d" % (Warnings)) + print("Functions Analyzed %d" % (FunctionsAnalyzed)) + print("Reachable Blocks %d" % (ReachableBlocks)) + print("Reached Max Steps %d" % (ReachedMaxSteps)) + print("Number of Steps %d" % (NumSteps)) + print("Number of Inlined calls %d (bifurcated %d)" % ( + NumInlinedCallSites, NumBifurcatedCallSites)) + print("MaxTime %f" % (MaxTime)) + print("TotalTime %f" % (TotalTime)) + print("Max CFG Size %d" % (MaxCFGSize)) |