[PATCH] D34564: [opt-viewer] Python 3 support in opt-stats.py
Brian Gesiak via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 23 11:53:26 PDT 2017
modocache created this revision.
Herald added a subscriber: fhahn.
Minor changes that allow opt-stats.py to support both Python 2 and 3.
https://reviews.llvm.org/D34564
Files:
utils/opt-viewer/opt-stats.py
utils/opt-viewer/optrecord.py
Index: utils/opt-viewer/optrecord.py
===================================================================
--- utils/opt-viewer/optrecord.py
+++ utils/opt-viewer/optrecord.py
@@ -117,7 +117,7 @@
def key(self):
k = (self.__class__, self.PassWithDiffPrefix, self.Name, self.File, self.Line, self.Column, self.Function)
for arg in self.Args:
- for (key, value) in arg.iteritems():
+ for (key, value) in iter(arg.items()):
if type(value) is dict:
value = tuple(value.items())
k += (key, value)
@@ -196,8 +196,8 @@
max_hotness = max(entry[0] for entry in remarks)
def merge_file_remarks(file_remarks_job, all_remarks, merged):
- for filename, d in file_remarks_job.iteritems():
- for line, remarks in d.iteritems():
+ for filename, d in iter(file_remarks_job.items()):
+ for line, remarks in iter(d.items()):
for remark in remarks:
# Bring max_hotness into the remarks so that
# RelativeHotness does not depend on an external global.
Index: utils/opt-viewer/opt-stats.py
===================================================================
--- utils/opt-viewer/opt-stats.py
+++ utils/opt-viewer/opt-stats.py
@@ -38,7 +38,7 @@
bypass = defaultdict(int)
byname = defaultdict(int)
- for r in all_remarks.itervalues():
+ for r in iter(all_remarks.values()):
bypass[r.Pass] += 1
byname[r.Pass + "/" + r.Name] += 1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34564.103758.patch
Type: text/x-patch
Size: 1546 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170623/edc06c91/attachment.bin>
More information about the llvm-commits
mailing list