Skip to content

Commit d369334

Browse files
committed
[NFC] Fix minor python issues.
* llvm-gisel-cov.py: extra `)` after print * chunk-print-before-all.py: py2-only print method
1 parent dc1056a commit d369334

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

llvm/utils/chunk-print-before-all.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# "crashinfo.txt" file leaving only the valid input IR in the last chunk.
66
# Files are written to current working directory.
77

8+
from __future__ import print_function
9+
810
import sys
911

1012
basename = "chunk-"
@@ -15,7 +17,7 @@ def print_chunk(lines):
1517
global basename
1618
fname = basename + str(chunk_id) + ".ll"
1719
chunk_id = chunk_id + 1
18-
print "writing chunk " + fname + " (" + str(len(lines)) + " lines)"
20+
print("writing chunk " + fname + " (" + str(len(lines)) + " lines)")
1921
with open(fname, "w") as f:
2022
f.writelines(lines)
2123

@@ -35,7 +37,7 @@ def print_chunk(lines):
3537
cur.append(line)
3638

3739
if is_dump:
38-
print "writing crashinfo.txt (" + str(len(cur)) + " lines)"
40+
print("writing crashinfo.txt (" + str(len(cur)) + " lines)")
3941
with open("crashinfo.txt", "w") as f:
4042
f.writelines(cur)
4143
else:

llvm/utils/llvm-gisel-cov.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ class FileFormatError(Exception):
1515

1616
def backend_int_pair(s):
1717
backend, sep, value = s.partition('=')
18-
if (sep is None):
18+
if sep is None:
1919
raise argparse.ArgumentTypeError("'=' missing, expected name=value")
20-
if (not backend):
20+
if not backend:
2121
raise argparse.ArgumentTypeError("Expected name=value")
22-
if (not value):
22+
if not value:
2323
raise argparse.ArgumentTypeError("Expected name=value")
2424
return backend, int(value)
2525

@@ -60,7 +60,7 @@ def main():
6060
num_rules = dict(args.num_rules)
6161
for backend, rules_for_backend in covered_rules.items():
6262
if backend in num_rules:
63-
print("%s: %3.2f%% of rules covered" % (backend, float(len(rules_for_backend)) / num_rules[backend]) * 100))
63+
print("%s: %3.2f%% of rules covered" % (backend, float(len(rules_for_backend)) / num_rules[backend]) * 100)
6464
else:
6565
print("%s: %d rules covered" % (backend, len(rules_for_backend)))
6666

0 commit comments

Comments
 (0)