[PATCH] D69719: [Utils] Hide the default behavior change of D68819 under a flag

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 1 09:22:38 PDT 2019


jdoerfert created this revision.
jdoerfert added reviewers: lebedev.ri, greened, spatel, xbolva00, RKSimon, mehdi_amini, davezarzycki, arichardson, nikic.
Herald added a subscriber: bollu.
Herald added a project: LLVM.

With D69701 <https://reviews.llvm.org/D69701>, the options used when running the script on a file will be
recorded and reused on a rerun. This allows us to hide new features
behind flags, starting with the "define" that was introduced in D68819 <https://reviews.llvm.org/D68819>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69719

Files:
  llvm/utils/UpdateTestChecks/common.py
  llvm/utils/update_cc_test_checks.py
  llvm/utils/update_test_checks.py


Index: llvm/utils/update_test_checks.py
===================================================================
--- llvm/utils/update_test_checks.py
+++ llvm/utils/update_test_checks.py
@@ -200,7 +200,7 @@
 
         # Print out the various check lines here.
         common.add_ir_checks(output_lines, ';', prefix_list, func_dict,
-                             func_name, args.preserve_names)
+                             func_name, args.preserve_names, args.function_signature)
         is_in_function_start = False
 
       if is_in_function:
Index: llvm/utils/update_cc_test_checks.py
===================================================================
--- llvm/utils/update_cc_test_checks.py
+++ llvm/utils/update_cc_test_checks.py
@@ -175,7 +175,7 @@
   for filename in args.tests:
     with open(filename) as f:
       input_lines = [l.rstrip() for l in f]
-    
+
     first_line = input_lines[0] if input_lines else ""
     if 'autogenerated' in first_line and script_name not in first_line:
       common.warn("Skipping test which wasn't autogenerated by " + script_name, filename)
@@ -286,7 +286,7 @@
             if added:
               output_lines.append('//')
             added.add(mangled)
-            common.add_ir_checks(output_lines, '//', run_list, func_dict, mangled, False)
+            common.add_ir_checks(output_lines, '//', run_list, func_dict, mangled, False, False)
       output_lines.append(line.rstrip('\n'))
 
     # Update the test file.
Index: llvm/utils/UpdateTestChecks/common.py
===================================================================
--- llvm/utils/UpdateTestChecks/common.py
+++ llvm/utils/UpdateTestChecks/common.py
@@ -326,9 +326,9 @@
       break
 
 def add_ir_checks(output_lines, comment_marker, prefix_list, func_dict,
-                  func_name, preserve_names):
+                  func_name, preserve_names, function_sig):
   # Label format is based on IR string.
-  function_def_regex = 'define {{[^@]+}}'
+  function_def_regex = 'define {{[^@]+}}' if function_sig else ''
   check_label_format = '{} %s-LABEL: {}@%s%s'.format(comment_marker, function_def_regex)
   add_checks(output_lines, comment_marker, prefix_list, func_dict, func_name,
              check_label_format, False, preserve_names)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69719.227466.patch
Type: text/x-patch
Size: 2261 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191101/5e92f4a5/attachment.bin>


More information about the llvm-commits mailing list