llvm.org GIT mirror llvm / ee72f59
Python compat - has_key vs. in operator Use portable `in` operator instead of `has_key(...)` method. Differential Revision: https://reviews.llvm.org/D56260 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350314 91177308-0d34-0410-b5e6-96231b3b80d8 Serge Guelton 1 year, 9 months ago
2 changed file(s) with 18 addition(s) and 18 deletion(s). Raw diff Collapse all Expand all
3535 else:
3636 fname = tmp[0].strip('\r\n')
3737
38 if not test.has_key(fname) :
38 if fname not in test :
3939 test[fname] = {}
4040
4141 for k in test:
7676 if DEBUG:
7777 print(t)
7878
79 if d_new.has_key(t) :
79 if t in d_new :
8080
8181 # Check if the test passed or failed.
8282 for x in test:
83 if d_old[t].has_key(x):
84 if d_new[t].has_key(x):
83 if x in d_old[t]:
84 if x in d_new[t]:
8585 if d_old[t][x] == 'PASS':
8686 if d_new[t][x] != 'PASS':
8787 print(t + " *** REGRESSION (" + x + ")\n")
9494
9595 # For execution time, if there is no result, its a fail.
9696 for x in exectime:
97 if d_old[t].has_key(tp + x):
98 if not d_new[t].has_key(tp + x):
97 if tp + x in d_old[t]:
98 if tp + x not in d_new[t]:
9999 print(t + " *** REGRESSION (" + tp + x + ")\n")
100100
101101 else :
102 if d_new[t].has_key(tp + x):
102 if tp + x in d_new[t]:
103103 print(t + " * NEW PASS (" + tp + x + ")\n")
104104
105105
106106 for x in comptime:
107 if d_old[t].has_key(exp + x):
108 if not d_new[t].has_key(exp + x):
107 if exp + x in d_old[t]:
108 if exp + x not in d_new[t]:
109109 print(t + " *** REGRESSION (" + exp + x + ")\n")
110110
111111 else :
112 if d_new[t].has_key(exp + x):
112 if exp + x in d_new[t]:
113113 print(t + " * NEW PASS (" + exp + x + ")\n")
114114
115115 else :
3232 else:
3333 fname = tmp[0].strip('\r\n')
3434
35 if not test.has_key(fname):
35 if fname not in test:
3636 test[fname] = {}
3737
3838 test[fname][t[1] + ' state'] = t[0]
7272 passes[x] = ''
7373
7474 for t in sorted(d_old.keys()) :
75 if d_new.has_key(t):
75 if t in d_new:
7676
7777 # Check if the test passed or failed.
7878 for x in ['compile state', 'compile time', 'exec state', 'exec time']:
7979
80 if not d_old[t].has_key(x) and not d_new[t].has_key(x):
80 if x not in d_old[t] and x not in d_new[t]:
8181 continue
8282
83 if d_old[t].has_key(x):
84 if d_new[t].has_key(x):
83 if x in d_old[t]:
84 if x in d_new[t]:
8585
8686 if d_old[t][x] == 'PASS':
8787 if d_new[t][x] != 'PASS':
9797 continue
9898
9999 # For execution time, if there is no result it's a fail.
100 if not d_old[t].has_key(x) and not d_new[t].has_key(x):
100 if x not in d_old[t] and x not in d_new[t]:
101101 continue
102 elif not d_new[t].has_key(x):
102 elif x not in d_new[t]:
103103 regressions[x] += t + "\n"
104 elif not d_old[t].has_key(x):
104 elif x not in d_old[t]:
105105 passes[x] += t + "\n"
106106
107107 if math.isnan(d_old[t][x]) and math.isnan(d_new[t][x]):