forked from OSchip/llvm-project
[opt-viewer] Remove positional arg checks (NFC)
Summary: opt-stats.py and opt-viewer.py's argument parsers both take a positional argument 'yaml_files'. Positional arguments in Python's argparse module are required by default, so the subsequent checks for `len(args.yaml_files) == 0` are unnecessary -- if the length was zero, then the call to `parser.parse_args()` would have thrown an error already. Because there is no way for `len(args.yaml_files)` to be zero at these points, removing the code is NFC. Reviewers: anemet, davidxl Reviewed By: anemet Subscribers: llvm-commits, fhahn Differential Revision: https://reviews.llvm.org/D34567 llvm-svn: 306147
This commit is contained in:
parent
6b124f29e7
commit
7e66b6b8ea
|
@ -24,10 +24,6 @@ if __name__ == '__main__':
|
|||
help='Max job count (defaults to %(default)s, the current CPU count)')
|
||||
args = parser.parse_args()
|
||||
|
||||
if len(args.yaml_files) == 0:
|
||||
parser.print_help()
|
||||
sys.exit(1)
|
||||
|
||||
if args.jobs == 1:
|
||||
pmap = map
|
||||
else:
|
||||
|
|
|
@ -216,10 +216,6 @@ if __name__ == '__main__':
|
|||
help='set source directory')
|
||||
args = parser.parse_args()
|
||||
|
||||
if len(args.yaml_files) == 0:
|
||||
parser.print_help()
|
||||
sys.exit(1)
|
||||
|
||||
if args.jobs == 1:
|
||||
pmap = map
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue