[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.)

llvm-svn: 158187
This commit is contained in:
Anna Zaks 2012-06-08 01:50:49 +00:00
parent 337a5a1c3f
commit d60367b893
1 changed files with 11 additions and 3 deletions

View File

@ -134,6 +134,14 @@ def loadResults(path, opts, deleteEmpty=True):
return run 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): def compareResults(A, B):
""" """
compareResults - Generate a relation from diagnostics in run A to compareResults - Generate a relation from diagnostics in run A to
@ -152,12 +160,12 @@ def compareResults(A, B):
neqB = [] neqB = []
eltsA = list(A.diagnostics) eltsA = list(A.diagnostics)
eltsB = list(B.diagnostics) eltsB = list(B.diagnostics)
eltsA.sort(key = lambda d: d.data) eltsA.sort(key = getIssueIdentifier)
eltsB.sort(key = lambda d: d.data) eltsB.sort(key = getIssueIdentifier)
while eltsA and eltsB: while eltsA and eltsB:
a = eltsA.pop() a = eltsA.pop()
b = eltsB.pop() b = eltsB.pop()
if a.data['location'] == b.data['location']: if (getIssueIdentifier(a) == getIssueIdentifier(b)) :
res.append((a, b, 0)) res.append((a, b, 0))
elif a.data > b.data: elif a.data > b.data:
neqA.append(a) neqA.append(a)