Skip to content

Commit

Permalink
Adds --arch option in regenerate-all.py script
Browse files Browse the repository at this point in the history
For the script to succeed it requires that MIPS & RISCV targets
are registered. The --arch option allows the script to run only
against the targets which you're building for.
  • Loading branch information
veselypeta committed Apr 26, 2024
1 parent 96b9e04 commit dc12882
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions llvm/test/CodeGen/CHERI-Generic/regenerate-all.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def __init__(self):
parser = argparse.ArgumentParser()
parser.add_argument("--llvm-bindir", type=Path, required=True)
parser.add_argument("--verbose", action="store_true")
parser.add_argument("--arch", default='all',
choices=[a.name for a in ALL_ARCHITECTURES]+['all'],
help="Architecture for which to generate tests: defaults to 'all'")
parser.add_argument("tests", default=[], nargs=argparse.ZERO_OR_MORE)
self.args = parser.parse_args()
print(self.args)
Expand Down Expand Up @@ -230,6 +233,8 @@ def update_one_test(test_name: str, input_file: typing.BinaryIO,
def main():
options = CmdArgs()
architectures = ALL_ARCHITECTURES
if options.args.arch != 'all':
architectures = [arch for arch in architectures if arch.name == options.args.arch]
# TODO: add command line flag to select subsets
# TODO: add option to delete all files that don't exist in Inputs/ to handle renaming
if options.args.tests:
Expand Down

0 comments on commit dc12882

Please sign in to comment.