[Darwin] Improve runtime OS version checks
authorJulian Lettner <julian.lettner@apple.com>
Thu, 14 May 2020 21:52:35 +0000 (14:52 -0700)
committerJulian Lettner <julian.lettner@apple.com>
Wed, 3 Jun 2020 20:44:11 +0000 (13:44 -0700)
commitba6b1b4353e33a7a36bcbad1d1c1157826197fd2
treec3ccb7d74ba10fa8d590a25a72fe2dc73b2bcd14
parent8bd7e4188a096b063065aac70ce39129c479f124
[Darwin] Improve runtime OS version checks

Use a struct to represent numerical versions instead of encoding release
names in an enumeration. This avoids the need to extend the enumeration
every time there is a new release.

Rename `GetMacosVersion() -> GetMacosAlignedVersion()` to better reflect
how this is used on non-MacOS platforms.

Reviewed By: delcypher

Differential Revision: https://reviews.llvm.org/D79970
compiler-rt/lib/sanitizer_common/sanitizer_mac.cpp
compiler-rt/lib/sanitizer_common/sanitizer_mac.h
compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cpp
compiler-rt/lib/tsan/rtl/tsan_platform_mac.cpp