clang: a C language family frontend for LLVM
来源:互联网 发布:淘宝食品类目有哪些 编辑:程序博客网 时间:2024/04/30 07:14
编译LLVM
http://clang.llvm.org/get_started.html
http://clang.llvm.org/
On Unix-like Systems
Note: as an experimental setup, you can use a single checkout with all the projects, and an easy CMake invocation, see the LLVM Doc "For developers to work with a git monorepo"
If you would like to check out and build Clang, the current procedure is as follows:
- Get the required tools.
- See Getting Started with the LLVM System - Requirements.
- Note also that Python is needed for running the test suite. Get it at: http://www.python.org/download
- Standard build process uses CMake. Get it at: http://www.cmake.org/download
- Check out LLVM:
- Change directory to where you want the llvm directory placed.
- svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
- Check out Clang:
- cd llvm/tools
- svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
- cd ../..
- Check out extra Clang tools: (optional)
- cd llvm/tools/clang/tools
- svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
- cd ../../../..
- Check out Compiler-RT (optional):
- cd llvm/projects
- svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
- cd ../..
- Check out libcxx: (only required to build and run Compiler-RT tests on OS X, optional otherwise)
- cd llvm/projects
- svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx
- cd ../..
- Build LLVM and Clang:
- mkdir build (in-tree build is not supported)
- cd build
- cmake -G "Unix Makefiles" ../llvm
- make
- This builds both LLVM and Clang for debug mode.
- Note: For subsequent Clang development, you can just run make clang.
- CMake allows you to generate project files for several IDEs: Xcode, Eclipse CDT4, CodeBlocks, Qt-Creator (use the CodeBlocks generator), KDevelop3. For more details see Building LLVM with CMake page.
- If you intend to use Clang's C++ support, you may need to tell it how to find your C++ standard library headers. In general, Clang will detect the best version of libstdc++ headers available and use them - it will look both for system installations of libstdc++ as well as installations adjacent to Clang itself. If your configuration fits neither of these scenarios, you can use the -DGCC_INSTALL_PREFIX cmake option to tell Clang where the gcc containing the desired libstdc++ is installed.
- Try it out (assuming you add llvm/build/bin to your path):
- clang --help
- clang file.c -fsyntax-only (check for correctness)
- clang file.c -S -emit-llvm -o - (print out unoptimized llvm code)
- clang file.c -S -emit-llvm -o - -O3
- clang file.c -S -O3 -o - (output native machine code)
- Run the testsuite:
- make check-clang
0 0
- clang: a C language family frontend for LLVM
- Compile LLVM+CLANG 4.0.1 for RHEL6
- LLVM/Clang
- LLVM & Clang
- LLVM及Clang、llvm-gcc
- LLVM及Clang、llvm-gcc
- clang and llvm
- LLVM 与 Clang 介绍
- LLVM 与 Clang 介绍
- LLVM 与 Clang 介绍
- LLVM 与 Clang介绍
- LLVM 与 Clang 介绍
- 测试llvm-clang编译器
- LLVM 与 Clang 介绍
- LLVM与Clang介绍
- codelite + clang + llvm
- clang和LLVM
- LLVM 与 Clang 介绍
- UITableView如何开启极简模式
- Python正则表达式验证邮箱
- IBM HyperLedger fabric基础
- sql 2008获取表字段说明
- 欢迎使用CSDN-markdown编辑器
- clang: a C language family frontend for LLVM
- Android SDK之系统权限
- (Ryan的Koa系列博客)6.依赖库:on-finished(本文尚未完成)
- 纯css小猫
- Android ContentProvider+获取系统联系人小Demo
- <iframe>标签自适应高度和宽度
- 在jsp的c标签循环后台对象属性的情况下,使用js提取其中一个id属性使用ajax传到后台删除
- iOS开源项目周报0216
- Java 基础