From: Zvi Rackover Date: Mon, 7 Nov 2016 18:08:19 +0000 (+0000) Subject: [X86] Fix test checks script to satisfy pyflakes X-Git-Tag: llvmorg-4.0.0-rc1~5339 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18082abfc2e59cbeff0273f937fc3e9f88e0c160;p=platform%2Fupstream%2Fllvm.git [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 --- diff --git a/llvm/utils/update_llc_test_checks.py b/llvm/utils/update_llc_test_checks.py index 12faa80..8ac9968 100755 --- a/llvm/utils/update_llc_test_checks.py +++ b/llvm/utils/update_llc_test_checks.py @@ -8,12 +8,10 @@ a single test function. """ import argparse -import itertools import os # Used to advertise this file's name ("autogenerated_note"). import string import subprocess import sys -import tempfile import re # Invoke the tool that is being tested. @@ -203,6 +201,7 @@ def main(): is_in_function = False is_in_function_start = False + func_name = None prefix_set = set([prefix for prefixes, _ in prefix_list for prefix in prefixes]) if args.verbose: print >>sys.stderr, 'Rewriting FileCheck prefixes: %s' % (prefix_set,) @@ -220,7 +219,7 @@ def main(): continue # 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 if is_in_function: @@ -242,8 +241,8 @@ def main(): m = IR_FUNCTION_RE.match(input_line) if not m: continue - name = m.group(1) - if args.function is not None and name != args.function: + func_name = m.group(1) + if args.function is not None and func_name != args.function: # When filtering on a specific function, skip all others. continue is_in_function = is_in_function_start = True