File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 5
5
# "crashinfo.txt" file leaving only the valid input IR in the last chunk.
6
6
# Files are written to current working directory.
7
7
8
+ from __future__ import print_function
9
+
8
10
import sys
9
11
10
12
basename = "chunk-"
@@ -15,7 +17,7 @@ def print_chunk(lines):
15
17
global basename
16
18
fname = basename + str (chunk_id ) + ".ll"
17
19
chunk_id = chunk_id + 1
18
- print "writing chunk " + fname + " (" + str (len (lines )) + " lines)"
20
+ print ( "writing chunk " + fname + " (" + str (len (lines )) + " lines)" )
19
21
with open (fname , "w" ) as f :
20
22
f .writelines (lines )
21
23
@@ -35,7 +37,7 @@ def print_chunk(lines):
35
37
cur .append (line )
36
38
37
39
if is_dump :
38
- print "writing crashinfo.txt (" + str (len (cur )) + " lines)"
40
+ print ( "writing crashinfo.txt (" + str (len (cur )) + " lines)" )
39
41
with open ("crashinfo.txt" , "w" ) as f :
40
42
f .writelines (cur )
41
43
else :
Original file line number Diff line number Diff line change @@ -15,11 +15,11 @@ class FileFormatError(Exception):
15
15
16
16
def backend_int_pair (s ):
17
17
backend , sep , value = s .partition ('=' )
18
- if ( sep is None ) :
18
+ if sep is None :
19
19
raise argparse .ArgumentTypeError ("'=' missing, expected name=value" )
20
- if ( not backend ) :
20
+ if not backend :
21
21
raise argparse .ArgumentTypeError ("Expected name=value" )
22
- if ( not value ) :
22
+ if not value :
23
23
raise argparse .ArgumentTypeError ("Expected name=value" )
24
24
return backend , int (value )
25
25
@@ -60,7 +60,7 @@ def main():
60
60
num_rules = dict (args .num_rules )
61
61
for backend , rules_for_backend in covered_rules .items ():
62
62
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 )
64
64
else :
65
65
print ("%s: %d rules covered" % (backend , len (rules_for_backend )))
66
66
You can’t perform that action at this time.
0 commit comments