[PATCH] D145484: [Tools] Changed the number printing format for sorting in chunk-print-before-all
Dmitry Bakunevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 7 02:40:06 PST 2023
dbakunevich created this revision.
dbakunevich added a reviewer: yrouban.
Herald added a project: All.
dbakunevich requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D145484
Files:
llvm/utils/chunk-print-before-all.py
Index: llvm/utils/chunk-print-before-all.py
===================================================================
--- llvm/utils/chunk-print-before-all.py
+++ llvm/utils/chunk-print-before-all.py
@@ -19,7 +19,7 @@
def print_chunk(lines, prefix, pass_name):
global chunk_id
- fname = str(chunk_id) + "-" + prefix + "-" + pass_name + ".ll"
+ fname = str(chunk_id).zfill(4) + "-" + prefix + "-" + pass_name + ".ll"
chunk_id = chunk_id + 1
print("writing chunk " + fname + " (" + str(len(lines)) + " lines)")
with open(fname, "w") as f:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145484.502968.patch
Type: text/x-patch
Size: 560 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230307/76e8fb01/attachment.bin>
More information about the llvm-commits
mailing list