Skip to content

Commit dc9c7f5

Browse files
author
dbakunevich
committed
[Tools] Changed the number printing format for sorting
As part of this patch, I added the ability to add leading zeros. This is necessary so that the generated files are sorted in ascending order. Reviewed By: yrouban Differential Revision: https://reviews.llvm.org/D145484
1 parent 4dd5e9c commit dc9c7f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def get_pass_name(line, prefix):
1919

2020
def print_chunk(lines, prefix, pass_name):
2121
global chunk_id
22-
fname = str(chunk_id) + "-" + prefix + "-" + pass_name + ".ll"
22+
fname = str(chunk_id).zfill(4) + "-" + prefix + "-" + pass_name + ".ll"
2323
chunk_id = chunk_id + 1
2424
print("writing chunk " + fname + " (" + str(len(lines)) + " lines)")
2525
with open(fname, "w") as f:

0 commit comments

Comments
 (0)