aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-11-15 22:42:44 +0000
committerAnna Zaks <ganna@apple.com>2012-11-15 22:42:44 +0000
commitf0024960d5f9edc5728128b49cb758e689dd3746 (patch)
tree17988cfb21ae4f14e80047cdb2a0e612e60ec391 /utils
parente8b5db4f2722991c37cc51ae9aa78e212c7e8514 (diff)
downloadclang-f0024960d5f9edc5728128b49cb758e689dd3746.tar.gz
[analyzer] CmpRuns: move the clang_version info into the run (out of
report) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rwxr-xr-xutils/analyzer/CmpRuns.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/utils/analyzer/CmpRuns.py b/utils/analyzer/CmpRuns.py
index 9b468bfefe..bca02124ee 100755
--- a/utils/analyzer/CmpRuns.py
+++ b/utils/analyzer/CmpRuns.py
@@ -120,9 +120,8 @@ class CmpOptions:
self.verboseLog = verboseLog
class AnalysisReport:
- def __init__(self, run, files, clang_vers):
+ def __init__(self, run, files):
self.run = run
- self.clang_version = clang_vers
self.files = files
self.diagnostics = []
@@ -134,6 +133,10 @@ class AnalysisRun:
self.reports = []
# Cumulative list of all diagnostics from all the reports.
self.diagnostics = []
+ self.clang_version = None
+
+ def getClangVersion(self):
+ return self.clang_version
# Backward compatibility API.
@@ -156,6 +159,15 @@ def loadResultsFromSingleRun(info, deleteEmpty=True):
p = os.path.join(dirpath, f)
data = plistlib.readPlist(p)
+ # We want to retrieve the clang version even if there are no
+ # reports. Assume that all reports were created using the same
+ # clang version (this is always true and is more efficient).
+ if ('clang_version' in data) :
+ if (run.clang_version == None) :
+ run.clang_version = data.pop('clang_version')
+ else:
+ data.pop('clang_version')
+
# Ignore/delete empty reports.
if not data['files']:
if deleteEmpty == True:
@@ -173,11 +185,7 @@ def loadResultsFromSingleRun(info, deleteEmpty=True):
else:
htmlFiles = [None] * len(data['diagnostics'])
- clang_version = ''
- if 'clang_version' in data:
- clang_version = data.pop('clang_version')
-
- report = AnalysisReport(run, data.pop('files'), clang_version)
+ report = AnalysisReport(run, data.pop('files'))
diagnostics = [AnalysisDiagnostic(d, report, h)
for d,h in zip(data.pop('diagnostics'),
htmlFiles)]