From 64774bafff420048a3ff6f45cb8543f6cc7bea36 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Mon, 4 Dec 2017 14:01:34 +0000 Subject: [PATCH] [NFC][lit] Use proper semantic versioning names for variables The variable named `minor` was actually pointing to the patch part of the version. While I was changing this I also made the check for Apple clang more robust by checking both patch and minor rather than just minor. llvm-svn: 319656 --- llvm/utils/lit/lit/llvm/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py index e3be929d716d..3c9a2cc559c1 100644 --- a/llvm/utils/lit/lit/llvm/config.py +++ b/llvm/utils/lit/lit/llvm/config.py @@ -225,9 +225,10 @@ class LLVMConfig(object): if re.match(r'^x86_64.*-apple', triple): version_regex = re.search(r'version ([0-9]+)\.([0-9]+).([0-9]+)', version_string) major_version_number = int(version_regex.group(1)) - minor_version_number = int(version_regex.group(3)) + minor_version_number = int(version_regex.group(2)) + patch_version_number = int(version_regex.group(3)) if 'Apple LLVM' in version_string: - return major_version_number >= 9 and minor_version_number > 0 + return major_version_number >= 9 and (minor_version_number > 0 or patch_version_number > 0) else: return major_version_number >= 5 -- GitLab