aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/common.py
diff options
context:
space:
mode:
authorMircea Trofin <mtrofin@google.com>2022-05-26 11:48:29 -0700
committerMircea Trofin <mtrofin@google.com>2022-05-26 11:55:19 -0700
commit6ddc4cd1c23fb2b418425543ea8c1554d4113f70 (patch)
tree083d26d743a99c550078be55d030a307854357f9 /llvm/utils/UpdateTestChecks/common.py
parent6273b5cbcdd346a833120c55061ab56f61827068 (diff)
downloadllvm-6ddc4cd1c23fb2b418425543ea8c1554d4113f70.zip
llvm-6ddc4cd1c23fb2b418425543ea8c1554d4113f70.tar.gz
llvm-6ddc4cd1c23fb2b418425543ea8c1554d4113f70.tar.bz2
Fix break introduced by D124306
argparse.BooleanOptionalAction is not supported until python 3.9.
Diffstat (limited to 'llvm/utils/UpdateTestChecks/common.py')
-rw-r--r--llvm/utils/UpdateTestChecks/common.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py
index 7ca546c..4ee6e09 100644
--- a/llvm/utils/UpdateTestChecks/common.py
+++ b/llvm/utils/UpdateTestChecks/common.py
@@ -131,8 +131,10 @@ def parse_commandline_args(parser):
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.')