11

Up to Xcode 6 when typing clang --version we got the information on what LLVM version it was built:

Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn)

But now with Xcode 7 we only get the following:

Apple LLVM version 7.0.0 (clang-700.0.72)
Stanislav Pankevich
  • 11,044
  • 8
  • 69
  • 129
Kevin MOLCARD
  • 2,168
  • 3
  • 22
  • 35

4 Answers4

5

See https://gist.github.com/yamaya/2924292 in which an interesting comment says:

Looking at the sources (src/CMakeLists.txt), it appears AppleClang is based on (approximately) the following LLVM branches: clang-700.0.72 => LLVM 3.7.0 clang-700.1.76 => LLVM 3.7.0 clang-700.1.81 => LLVM 3.7.0 clang-703.0.29 => LLVM 3.8.0 clang-703.0.31 => LLVM 3.8.0

Jack Wasey
  • 3,360
  • 24
  • 43
4

The LLVM version reported was always misleading. "3.6.0svn" means that code was branched some time after 3.5 and before 3.6. However, Apple also applies bunch of local changes and backports bug fixes, so there is no way in general to relate to a particular mainline revision. This is why they removed it. And really, one need to treat Apple-shipped clang as a separate compiler (compared to the mainline clang).

Anton Korobeynikov
  • 9,074
  • 25
  • 28
  • So how do you find documentation about what features are supported? – hadley Oct 21 '15 at 11:50
  • @hadley, the only reliable way it to use __has_feature macro to check for a particular feature. Given the whole mess with the version, I wouldn't trust anything else. Is there any particulare "feature" you're interested in? – Anton Korobeynikov Oct 22 '15 at 01:00
  • 3
    I meant feature in the sense of what command line flags does clang support. i.e. how do you get to the equivalent of http://clang.llvm.org/docs/UsersManual.html? `man clang` doesn't appear to be comprehensive. – hadley Oct 22 '15 at 13:12
  • `configure` script is the fallback, I guess. – Jack Wasey May 03 '17 at 01:39
2

The wiki had show us already. https://en.wikipedia.org/wiki/Xcode#Latest_versions

Actually we can check swift version the Xcode used, and see the llvm version in swift-llvm

For Xcode 10, the swift version is 4.2, from CMakeLists.txt we can get the llvm version is 6.0.1 if(NOT DEFINED LLVM_VERSION_MAJOR) set(LLVM_VERSION_MAJOR 6) endif() if(NOT DEFINED LLVM_VERSION_MINOR) set(LLVM_VERSION_MINOR 0) endif() if(NOT DEFINED LLVM_VERSION_PATCH) set(LLVM_VERSION_PATCH 1) endif()

And Apple should not use two versions of llvm in clang and swift :)

J1ngB0
  • 41
  • 3
  • 2
    Not that the answer is wrong, but providing links is okay if you also provide the answer directly, that way even dead links won't impact your answer validity – Mikitori Dec 27 '18 at 08:58
1

wiki of xcode should be helpful.

Xcode7.0 => LLVM3.7.0

CK98
  • 46
  • 4