[cfe-commits] r158187 - /cfe/trunk/utils/analyzer/CmpRuns.py
Anna Zaks
ganna at apple.com
Thu Jun 7 18:50:50 PDT 2012
Author: zaks
Date: Thu Jun 7 20:50:49 2012
New Revision: 158187
URL: http://llvm.org/viewvc/llvm-project?rev=158187&view=rev
Log:
[analyzer] Use "issue hash" in CmpRuns; followup on r158180
(For the future: It would be more efficient to produce a hash key with
the embedded function info inside the compiler.)
Modified:
cfe/trunk/utils/analyzer/CmpRuns.py
Modified: cfe/trunk/utils/analyzer/CmpRuns.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/analyzer/CmpRuns.py?rev=158187&r1=158186&r2=158187&view=diff
==============================================================================
--- cfe/trunk/utils/analyzer/CmpRuns.py (original)
+++ cfe/trunk/utils/analyzer/CmpRuns.py Thu Jun 7 20:50:49 2012
@@ -134,6 +134,14 @@
return run
+def getIssueIdentifier(d) :
+ id = ''
+ if 'issue_context' in d.data :
+ id += d.data['issue_context']
+ if 'issue_hash' in d.data :
+ id += str(d.data['issue_hash'])
+ return id
+
def compareResults(A, B):
"""
compareResults - Generate a relation from diagnostics in run A to
@@ -152,12 +160,12 @@
neqB = []
eltsA = list(A.diagnostics)
eltsB = list(B.diagnostics)
- eltsA.sort(key = lambda d: d.data)
- eltsB.sort(key = lambda d: d.data)
+ eltsA.sort(key = getIssueIdentifier)
+ eltsB.sort(key = getIssueIdentifier)
while eltsA and eltsB:
a = eltsA.pop()
b = eltsB.pop()
- if a.data['location'] == b.data['location']:
+ if (getIssueIdentifier(a) == getIssueIdentifier(b)) :
res.append((a, b, 0))
elif a.data > b.data:
neqA.append(a)
More information about the cfe-commits
mailing list