[lit] Use argparse instead of optparse
authorChris Bieneman <beanz@apple.com>
Mon, 3 Oct 2016 22:12:42 +0000 (22:12 +0000)
committerChris Bieneman <beanz@apple.com>
Mon, 3 Oct 2016 22:12:42 +0000 (22:12 +0000)
commit1f49329e81fd11c357d45b457ba2e8eb28df1288
tree439c11fcfb0fa3edaaa70a5a9ab36222ba1db33f
parent9baa3e80a9abcc4ebb72e5a83a3269b36021de78
[lit] Use argparse instead of optparse

Summary:
optparse is deprecated in Python 2.7, which is the minimum version of
Python required to run the LLVM test suite. Replace its usage in lit
with argparse, optparse's 2.7 replacement module.

argparse has several benefits over optparse, but this commit does not
make use of those benefits yet. Instead, it simply uses the new API,
and attempts to keep the number of changes to a minimum.

Confirmed that lit's test suite, as well as LLVM's regression test suite,
still pass with these changes.

Patch By Brian Gesiak!

Reviewers: ddunbar, echristo, beanz, delcypher

Subscribers: llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D25173

llvm-svn: 283152
llvm/utils/lit/lit/main.py
llvm/utils/lit/tests/usage.py