[llvm] 6ddc4cd - Fix break introduced by D124306

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Thu May 26 11:55:28 PDT 2022


Author: Mircea Trofin
Date: 2022-05-26T11:55:19-07:00
New Revision: 6ddc4cd1c23fb2b418425543ea8c1554d4113f70

URL: https://github.com/llvm/llvm-project/commit/6ddc4cd1c23fb2b418425543ea8c1554d4113f70
DIFF: https://github.com/llvm/llvm-project/commit/6ddc4cd1c23fb2b418425543ea8c1554d4113f70.diff

LOG: Fix break introduced by D124306

argparse.BooleanOptionalAction is not supported until python 3.9.

Added: 
    

Modified: 
    llvm/utils/UpdateTestChecks/common.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py
index 7ca546c3d251e..4ee6e0927a1d2 100644
--- a/llvm/utils/UpdateTestChecks/common.py
+++ b/llvm/utils/UpdateTestChecks/common.py
@@ -131,8 +131,10 @@ def __call__(self, parser, namespace, values, option_string=None):
                       help='List of regular expressions that a global value declaration must match to generate a check (has no effect if checking globals is not enabled)')
   parser.add_argument('--global-hex-value-regex', nargs='+', default=[],
                       help='List of regular expressions such that, for matching global value declarations, literal integer values should be encoded in hex in the associated FileCheck directives')
-  parser.add_argument('--generate-body-for-unused-prefixes',
-                      action=argparse.BooleanOptionalAction,
+  # FIXME: in 3.9, we can use argparse.BooleanOptionalAction. At that point,
+  # we need to rename the flag to just -generate-body-for-unused-prefixes.
+  parser.add_argument('--no-generate-body-for-unused-prefixes',
+                      action='store_false',
                       dest='gen_unused_prefix_body',
                       default=True,
                       help='Generate a function body that always matches for unused prefixes. This is useful when unused prefixes are desired, and it avoids needing to annotate each FileCheck as allowing them.')


        


More information about the llvm-commits mailing list