[PATCH] D154383: [UTC] Add do-not-autogenerate capability

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 3 11:44:23 PDT 2023


probinson created this revision.
probinson added a reviewer: eli.friedman.
Herald added a subscriber: arichardson.
Herald added a project: All.
probinson requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

A file with manual checks that should be preserved can now be
protected against accidental updates by a script.


https://reviews.llvm.org/D154383

Files:
  llvm/utils/UpdateTestChecks/common.py


Index: llvm/utils/UpdateTestChecks/common.py
===================================================================
--- llvm/utils/UpdateTestChecks/common.py
+++ llvm/utils/UpdateTestChecks/common.py
@@ -323,6 +323,9 @@
             with open(test) as f:
                 input_lines = [l.rstrip() for l in f]
             first_line = input_lines[0] if input_lines else ""
+            if UTC_AVOID in first_line:
+              warn("Skipping test that must not be autogenerated: " + test)
+              continue
             is_regenerate = UTC_ADVERT in first_line
 
             # If we're generating a new test, set the default version to the latest.
@@ -464,6 +467,7 @@
 UTC_ARGS_KEY = "UTC_ARGS:"
 UTC_ARGS_CMD = re.compile(r".*" + UTC_ARGS_KEY + "\s*(?P<cmd>.*)\s*$")
 UTC_ADVERT = "NOTE: Assertions have been autogenerated by "
+UTC_AVOID = "NOTE: Do not autogenerate "
 UNUSED_NOTE = "NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:"
 
 OPT_FUNCTION_RE = re.compile(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154383.536856.patch
Type: text/x-patch
Size: 1025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230703/9aac1d69/attachment.bin>


More information about the llvm-commits mailing list