[llvm] r286128 - [X86] Fix test checks script to satisfy pyflakes

Zvi Rackover via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 10:08:20 PST 2016


Author: zvi
Date: Mon Nov  7 12:08:19 2016
New Revision: 286128

URL: http://llvm.org/viewvc/llvm-project?rev=286128&view=rev
Log:
[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.

Modified:
    llvm/trunk/utils/update_llc_test_checks.py

Modified: llvm/trunk/utils/update_llc_test_checks.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/update_llc_test_checks.py?rev=286128&r1=286127&r2=286128&view=diff
==============================================================================
--- llvm/trunk/utils/update_llc_test_checks.py (original)
+++ llvm/trunk/utils/update_llc_test_checks.py Mon Nov  7 12:08:19 2016
@@ -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




More information about the llvm-commits mailing list