简体   繁体   English

如何通过clang版本查看clang源?

[英]How can I check out clang sources by clang version?

With latest XCode clang compiler version 4.2.1 is supplied. 使用最新的XCode clang编译器版本4.2.1。

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -dumpversion

And I need to check out exactly that version of clang source code, what I am using in XCode. 我需要查看那个版本的clang源代码,我在XCode中使用的是什么。 (Needed for building clang plugin on sources and load it to clang that used by Xcode) (需要在源代码上构建clang插件并将其加载到Xcode使用的clang)

But when I do: 但当我这样做时:

svn ls http://llvm.org/svn/llvm-project/cfe/tags/

there are only relese numbers (I have tried to look versions in other files): 只有相关的数字(我试图在其他文件中查看版本):

RELEASE_26/
RELEASE_27/
RELEASE_28/
RELEASE_29/
RELEASE_30/
RELEASE_31/
RELEASE_32/
RELEASE_33/
RELEASE_34/

How can I check out sources of clang and llvm that are used in 4.2.1 version? 如何查看4.2.1版本中使用的clang和llvm的来源?

Update: 更新:

I downloaded those sources (XCode clang version): 我下载了这些来源(XCode clang版本):

http://llvm.org/releases/download.html#3.3 http://llvm.org/releases/download.html#3.3

But there is unexpected error with building command: 但构建命令出现意外错误:

llvm-3.3.src/projects/compiler-rt/lib/asan/asan_mac.cc:26:10: fatal error: ‘crt_externs.h’ file not found
#include // for _NSGetArgv
^
1 error generated.

Can I set other instance of clang in XCode instead of 我可以在XCode中设置其他clang实例而不是

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang ? /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang?

Apple's release schedule rarely corresponds with LLVM's. Apple的发布时间表很少与LLVM相对应。

So what they do (I am inferring here), is to branch the LLVM repo, add any "proprietary" bits that that they have developed and are not yet in the open source version (For example, the ARM64 backend that they used for the iPhone 5). 所以他们所做的(我在这里推断)是分支LLVM仓库,添加他们已经开发并且还没有开源版本的任何“专有”位(例如,用于它们的ARM64后端) iphone 5)。 Then they test (and fix bugs) until they're happy. 然后他们测试(并修复bug),直到他们开心。 They give this an Apple version #, and ship it. 他们给这个苹果版#,并发货。

For example, on my system, with Xcode 5.0.1 installed, I get: 例如,在我的系统上,安装了Xcode 5.0.1,我得到:

$ clang --version
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)

You can download the sources to the version of clang that Apple ships with Xcode from http://opensource.apple.com 您可以从http://opensource.apple.com下载源代码到Apple随Xcode提供的clang版本

However, it doesn't look like they've put up the sources for the 5.0 tools yet. 但是,看起来他们还没有提供5.0工具的来源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM