[LNT] r285635 - Set default values before conditionals

Mandeep Singh Grang via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 13:54:23 PDT 2016


Author: mgrang
Date: Mon Oct 31 15:54:23 2016
New Revision: 285635

URL: http://llvm.org/viewvc/llvm-project?rev=285635&view=rev
Log:
Set default values before conditionals

Summary: Patch by Azharuddin Mohammed

Reviewers: hfinkel, MatzeB, mgrang, cmatthews

Subscribers: llvm-commits

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

Modified:
    lnt/trunk/lnt/testing/util/compilers.py

Modified: lnt/trunk/lnt/testing/util/compilers.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/testing/util/compilers.py?rev=285635&r1=285634&r2=285635&view=diff
==============================================================================
--- lnt/trunk/lnt/testing/util/compilers.py (original)
+++ lnt/trunk/lnt/testing/util/compilers.py Mon Oct 31 15:54:23 2016
@@ -64,6 +64,7 @@ def get_cc_info(path, cc_flags=[]):
     # Parse out the compiler's version line and the path to the "cc1" binary.
     cc1_binary = None
     version_ln = None
+    cc_name = cc_version_num = cc_build_string = cc_extra = ""
     for ln in cc_version.split('\n'):
         if ' version ' in ln:
             version_ln = ln
@@ -90,12 +91,10 @@ def get_cc_info(path, cc_flags=[]):
             m = re.match(r'(.*) version ([^ ]*)', version_ln)
             if m is not None:
                 cc_name,cc_version_num = m.groups()
-                cc_build_string = cc_extra = ""
             else:
                 error("unable to determine compiler version: %r: %r" % (
                         cc, version_ln))
                 cc_name = "unknown"
-                cc_version_num = cc_build_string = cc_extra = ""
 
     # Compute normalized compiler name and type. We try to grab source
     # revisions, branches, and tags when possible.




More information about the llvm-commits mailing list