What is the LLVM version bundled with Xcode?

一个人想着一个人 提交于 2019-12-18 15:06:54

问题


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)

回答1:


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




回答2:


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).




回答3:


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 :)



来源:https://stackoverflow.com/questions/32985758/what-is-the-llvm-version-bundled-with-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!