[llvm] Fix compiler errors in GVN.h for clang versions older than 15 (PR #107636)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 6 13:13:47 PDT 2024
================
@@ -130,7 +130,12 @@
#if (!(defined(_WIN32) || defined(__CYGWIN__)) || \
(defined(__MINGW32__) && defined(__clang__)))
+// Clang compilers older then 15 do not support gnu style attributes on namespaces
+#if defined(__clang__) && _clang_major__ < 15
----------------
mstorsjo wrote:
Typo, you have one leading underscore on `__clang_major__` while you should have two.
Note that with Apple Clang, there's a separate different versioning, where `__clang_major__` reflects the Apple versioning. If `__apple_build_version__` is defined, then `__clang_major__` reflects the Xcode version number, distinct from the upstream LLVM.org version numbers.
According to https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_(since_SwiftUI_framework)_2, Xcode 14.0 - 14.2 maps to LLVM 14.0, while Xcode 14.3 maps to LLVM 15.0.
So out of pure luck and coincidence, the cutoff we're looking at might actually mostly work out here with one single version number check :-)
https://github.com/llvm/llvm-project/pull/107636
More information about the llvm-commits
mailing list