[PATCH] D92542: [tools] Update update_test_prefix.py to handle %s after prefixes
Mircea Trofin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 2 21:38:13 PST 2020
mtrofin created this revision.
mtrofin added a reviewer: pengfei.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
mtrofin requested review of this revision.
Sometimes the check-prefixes is followed by %s, and we want to keep a
white space before it.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D92542
Files:
llvm/utils/update_test_prefix.py
Index: llvm/utils/update_test_prefix.py
===================================================================
--- llvm/utils/update_test_prefix.py
+++ llvm/utils/update_test_prefix.py
@@ -18,8 +18,7 @@
s = re.sub(',' + p + '([, \n])', '\\1', s)
s = re.sub('\s+-?-check-prefix=' + p + '([ \n])', '\\1', s)
else:
- s = re.sub('-?-check-prefixes=([^, ]+\n)', '--check-prefix=\\1', s)
- s = re.sub('-?-check-prefixes=([^, ]+) ', '--check-prefix=\\1', s)
+ s = re.sub('-?-check-prefixes=([\w-]+[\s]*) ', '--check-prefix=\\1', s)
t = re.search('-?-check-(?:prefix|prefixes)=([^ ]+)\s+-?-check-(?:prefix|prefixes)=([^ ]+)', s)
while t:
s = re.sub(t.group(), '--check-prefixes=' + t.group(1) + ',' + t.group(2), s)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92542.309152.patch
Type: text/x-patch
Size: 816 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201203/1ede242f/attachment.bin>
More information about the llvm-commits
mailing list