[X86] Fix test checks script to satisfy pyflakes

- Remove unused imports.
- Initialize the variable 'name' before its (static) uses, and rename it to a
  more descriptive name.

llvm-svn: 286128
This commit is contained in:
Zvi Rackover 2016-11-07 18:08:19 +00:00
parent 1697d39eef
commit 18082abfc2
1 changed files with 4 additions and 5 deletions

View File

@ -8,12 +8,10 @@ a single test function.
""" """
import argparse import argparse
import itertools
import os # Used to advertise this file's name ("autogenerated_note"). import os # Used to advertise this file's name ("autogenerated_note").
import string import string
import subprocess import subprocess
import sys import sys
import tempfile
import re import re
# Invoke the tool that is being tested. # Invoke the tool that is being tested.
@ -203,6 +201,7 @@ def main():
is_in_function = False is_in_function = False
is_in_function_start = False is_in_function_start = False
func_name = None
prefix_set = set([prefix for prefixes, _ in prefix_list for prefix in prefixes]) prefix_set = set([prefix for prefixes, _ in prefix_list for prefix in prefixes])
if args.verbose: if args.verbose:
print >>sys.stderr, 'Rewriting FileCheck prefixes: %s' % (prefix_set,) print >>sys.stderr, 'Rewriting FileCheck prefixes: %s' % (prefix_set,)
@ -220,7 +219,7 @@ def main():
continue continue
# Print out the various check lines here. # Print out the various check lines here.
output_lines = add_checks(output_lines, prefix_list, func_dict, name) output_lines = add_checks(output_lines, prefix_list, func_dict, func_name)
is_in_function_start = False is_in_function_start = False
if is_in_function: if is_in_function:
@ -242,8 +241,8 @@ def main():
m = IR_FUNCTION_RE.match(input_line) m = IR_FUNCTION_RE.match(input_line)
if not m: if not m:
continue continue
name = m.group(1) func_name = m.group(1)
if args.function is not None and name != args.function: if args.function is not None and func_name != args.function:
# When filtering on a specific function, skip all others. # When filtering on a specific function, skip all others.
continue continue
is_in_function = is_in_function_start = True is_in_function = is_in_function_start = True