到http://releases.llvm.org/download.html下載LLVM和clang源碼
比如:
http://releases.llvm.org/6.0.0/llvm-6.0.0.src.tar.xz
http://releases.llvm.org/6.0.0/cfe-6.0.0.src.tar.xz
將llvm-6.0.0.src.tar.xz解壓到D:\LLVM
將cfe-6.0.0.src.tar.xz解壓到D:\LLVM\tools\
將cfe-6.0.0.src重命名位clang
到https://cmake.org/download/下載cmake,雙擊cmake-gui,在where is source code處填寫D:\LLVM
where to build the binaries 處填寫一個生成vs解決方案的地方
點擊configure,填入如下信息,

選生成器的時候,帶着win64則生成64位的解決方案,不帶則生成32解決方案。
host=x64建議填寫,否則編譯的時候會出現
類似“The problem arises when the build process gets to the "clangBasic" project. It fails on line 254 of "identifiertable.cpp," which I will attach. All other projects that depend on clangBasic fail. This bug only arises on the Release configuration.”
的fatal error C1002: 在第2遍中編譯器的堆空間不足錯誤提示。
