OSDN Git Service

[opt-viewer] Remove positional arg checks (NFC)
authorBrian Gesiak <modocache@gmail.com>
Fri, 23 Jun 2017 20:06:34 +0000 (20:06 +0000)
committerBrian Gesiak <modocache@gmail.com>
Fri, 23 Jun 2017 20:06:34 +0000 (20:06 +0000)
commitddb4efa8b2bec97dedf9580bca5fff38af6670ba
treec749f4e93f092809bcbd9add90befffa7af64108
parent87f3ec22f791e3873d9001a88f5d781352ed8d2a
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306147 91177308-0d34-0410-b5e6-96231b3b80d8
utils/opt-viewer/opt-stats.py
utils/opt-viewer/opt-viewer.py