summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/scripts
diff options
context:
space:
mode:
authorGreg Fitzgerald <gregf@codeaurora.org>2014-05-14 23:31:20 +0000
committerGreg Fitzgerald <gregf@codeaurora.org>2014-05-14 23:31:20 +0000
commit6ff852fe1b49518b4f6419792c9381b43d3e1f7c (patch)
treeab77d7753511e773a8ac78bd3623b13ba39ee6e6 /lib/sanitizer_common/scripts
parentabb4c6d7ac86dbca37ae325a18fe55c007f76218 (diff)
migrate litlint from argparse to optparse. reenabled
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208826 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/scripts')
-rwxr-xr-xlib/sanitizer_common/scripts/check_lint.sh3
-rwxr-xr-xlib/sanitizer_common/scripts/litlint.py11
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/sanitizer_common/scripts/check_lint.sh b/lib/sanitizer_common/scripts/check_lint.sh
index 45d61cbd1..0b7aea1ae 100755
--- a/lib/sanitizer_common/scripts/check_lint.sh
+++ b/lib/sanitizer_common/scripts/check_lint.sh
@@ -50,8 +50,7 @@ run_lint() {
if [[ "${SILENT}" != "1" ]]; then
cat $TASK_LOG
fi
-# litlint disabled because it requires Python 2.7 or later
-# ${LITLINT} "$@" 2>>$ERROR_LOG
+ ${LITLINT} "$@" 2>>$ERROR_LOG
}
run_lint ${LLVM_LINT_FILTER} --filter=${LLVM_LINT_FILTER} \
diff --git a/lib/sanitizer_common/scripts/litlint.py b/lib/sanitizer_common/scripts/litlint.py
index 15b496ff4..b82eec290 100755
--- a/lib/sanitizer_common/scripts/litlint.py
+++ b/lib/sanitizer_common/scripts/litlint.py
@@ -5,14 +5,13 @@
# Check that the RUN commands in lit tests can be executed with an emulator.
#
-import argparse
+import optparse
import re
import sys
-parser = argparse.ArgumentParser(description='lint lit tests')
-parser.add_argument('filenames', nargs='+')
-parser.add_argument('--filter') # ignored
-args = parser.parse_args()
+parser = optparse.OptionParser()
+parser.add_option('--filter') # ignored
+(options, filenames) = parser.parse_args()
runRegex = re.compile(r'(?<!-o)(?<!%run) %t\s')
errorMsg = "litlint: {}:{}: error: missing %run before %t.\n\t{}"
@@ -23,5 +22,5 @@ def LintFile(p):
if runRegex.search(s):
sys.stderr.write(errorMsg.format(p, i, s))
-for p in args.filenames:
+for p in filenames:
LintFile(p)