<p dir="ltr">This changed the whole file, you probably messed up the line endings. Can you revert this, fix your local client configuration, and Ireland just the modified lines?</p>
<div class="gmail_quote">On Jan 10, 2013 11:09 PM, "Nikola Smiljanic" <<a href="mailto:popizdeh@gmail.com">popizdeh@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: nikola<br>
Date: Fri Jan 11 01:09:00 2013<br>
New Revision: 172177<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=172177&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=172177&view=rev</a><br>
Log:<br>
Fix spelling error and remove the part about CMake having experimental Ninja support since 2.8.9 has been released some time ago.<br>
<br>
Modified:<br>
cfe/trunk/docs/HowToSetupToolingForLLVM.rst<br>
<br>
Modified: cfe/trunk/docs/HowToSetupToolingForLLVM.rst<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/HowToSetupToolingForLLVM.rst?rev=172177&r1=172176&r2=172177&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/HowToSetupToolingForLLVM.rst?rev=172177&r1=172176&r2=172177&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/docs/HowToSetupToolingForLLVM.rst (original)<br>
+++ cfe/trunk/docs/HowToSetupToolingForLLVM.rst Fri Jan 11 01:09:00 2013<br>
@@ -1,211 +1,199 @@<br>
-===================================<br>
-How To Setup Clang Tooling For LLVM<br>
-===================================<br>
-<br>
-Clang Tooling provides infrastructure to write tools that need syntactic<br>
-and semantic infomation about a program. This term also relates to a set<br>
-of specific tools using this infrastructure (e.g. ``clang-check``). This<br>
-document provides information on how to set up and use Clang Tooling for<br>
-the LLVM source code.<br>
-<br>
-Introduction<br>
-============<br>
-<br>
-Clang Tooling needs a compilation database to figure out specific build<br>
-options for each file. Currently it can create a compilation database<br>
-from the ``compilation_commands.json`` file, generated by CMake. When<br>
-invoking clang tools, you can either specify a path to a build directory<br>
-using a command line parameter ``-p`` or let Clang Tooling find this<br>
-file in your source tree. In either case you need to configure your<br>
-build using CMake to use clang tools.<br>
-<br>
-Setup Clang Tooling Using CMake and Make<br>
-========================================<br>
-<br>
-If you intend to use make to build LLVM, you should have CMake 2.8.6 or<br>
-later installed (can be found `here <<a href="http://cmake.org" target="_blank">http://cmake.org</a>>`_).<br>
-<br>
-First, you need to generate Makefiles for LLVM with CMake. You need to<br>
-make a build directory and run CMake from it:<br>
-<br>
-.. code-block:: console<br>
-<br>
- $ mkdir your/build/directory<br>
- $ cd your/build/directory<br>
- $ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON path/to/llvm/sources<br>
-<br>
-If you want to use clang instead of GCC, you can add<br>
-``-DCMAKE_C_COMPILER=/path/to/clang -DCMAKE_CXX_COMPILER=/path/to/clang++``.<br>
-You can also use ``ccmake``, which provides a curses interface to configure<br>
-CMake variables for lazy people.<br>
-<br>
-As a result, the new ``compile_commands.json`` file should appear in the<br>
-current directory. You should link it to the LLVM source tree so that<br>
-Clang Tooling is able to use it:<br>
-<br>
-.. code-block:: console<br>
-<br>
- $ ln -s $PWD/compile_commands.json path/to/llvm/source/<br>
-<br>
-Now you are ready to build and test LLVM using make:<br>
-<br>
-.. code-block:: console<br>
-<br>
- $ make check-all<br>
-<br>
-Using Clang Tools<br>
-=================<br>
-<br>
-After you completed the previous steps, you are ready to run clang tools. If<br>
-you have a recent clang installed, you should have ``clang-check`` in<br>
-``$PATH``. Try to run it on any ``.cpp`` file inside the LLVM source tree:<br>
-<br>
-.. code-block:: console<br>
-<br>
- $ clang-check tools/clang/lib/Tooling/CompilationDatabase.cpp<br>
-<br>
-If you're using vim, it's convenient to have clang-check integrated. Put<br>
-this into your ``.vimrc``:<br>
-<br>
-::<br>
-<br>
- function! ClangCheckImpl(cmd)<br>
- if &autowrite | wall | endif<br>
- echo "Running " . a:cmd . " ..."<br>
- let l:output = system(a:cmd)<br>
- cexpr l:output<br>
- cwindow<br>
- let w:quickfix_title = a:cmd<br>
- if v:shell_error != 0<br>
- cc<br>
- endif<br>
- let g:clang_check_last_cmd = a:cmd<br>
- endfunction<br>
-<br>
- function! ClangCheck()<br>
- let l:filename = expand('%')<br>
- if l:filename =~ '\.\(cpp\|cxx\|cc\|c\)$'<br>
- call ClangCheckImpl("clang-check " . l:filename)<br>
- elseif exists("g:clang_check_last_cmd")<br>
- call ClangCheckImpl(g:clang_check_last_cmd)<br>
- else<br>
- echo "Can't detect file's compilation arguments and no previous clang-check invocation!"<br>
- endif<br>
- endfunction<br>
-<br>
- nmap <silent> <F5> :call ClangCheck()<CR><CR><br>
-<br>
-When editing a .cpp/.cxx/.cc/.c file, hit F5 to reparse the file. In<br>
-case the current file has a different extension (for example, .h), F5<br>
-will re-run the last clang-check invocation made from this vim instance<br>
-(if any). The output will go into the error window, which is opened<br>
-automatically when clang-check finds errors, and can be re-opened with<br>
-``:cope``.<br>
-<br>
-Other ``clang-check`` options that can be useful when working with clang<br>
-AST:<br>
-<br>
-* ``-ast-print`` --- Build ASTs and then pretty-print them.<br>
-* ``-ast-dump`` --- Build ASTs and then debug dump them.<br>
-* ``-ast-dump-filter=<string>`` --- Use with ``-ast-dump`` or ``-ast-print`` to<br>
- dump/print only AST declaration nodes having a certain substring in a<br>
- qualified name. Use ``-ast-list`` to list all filterable declaration node<br>
- names.<br>
-* ``-ast-list`` --- Build ASTs and print the list of declaration node qualified<br>
- names.<br>
-<br>
-Examples:<br>
-<br>
-.. code-block:: console<br>
-<br>
- $ clang-check tools/clang/tools/clang-check/ClangCheck.cpp -ast-dump -ast-dump-filter ActionFactory::newASTConsumer<br>
- Processing: tools/clang/tools/clang-check/ClangCheck.cpp.<br>
- Dumping ::ActionFactory::newASTConsumer:<br>
- clang::ASTConsumer *newASTConsumer() (CompoundStmt 0x44da290 </home/alexfh/local/llvm/tools/clang/tools/clang-check/ClangCheck.cpp:64:40, line:72:3><br>
- (IfStmt 0x44d97c8 <line:65:5, line:66:45><br>
- <<<NULL>>><br>
- (ImplicitCastExpr 0x44d96d0 <line:65:9> '_Bool':'_Bool' <UserDefinedConversion><br>
- ...<br>
- $ clang-check tools/clang/tools/clang-check/ClangCheck.cpp -ast-print -ast-dump-filter ActionFactory::newASTConsumer<br>
- Processing: tools/clang/tools/clang-check/ClangCheck.cpp.<br>
- Printing <anonymous namespace>::ActionFactory::newASTConsumer:<br>
- clang::ASTConsumer *newASTConsumer() {<br>
- if (this->ASTList.operator _Bool())<br>
- return clang::CreateASTDeclNodeLister();<br>
- if (this->ASTDump.operator _Bool())<br>
- return clang::CreateASTDumper(this->ASTDumpFilter);<br>
- if (this->ASTPrint.operator _Bool())<br>
- return clang::CreateASTPrinter(&llvm::outs(), this->ASTDumpFilter);<br>
- return new clang::ASTConsumer();<br>
- }<br>
-<br>
-(Experimental) Using Ninja Build System<br>
-=======================================<br>
-<br>
-Optionally you can use the `Ninja <<a href="https://github.com/martine/ninja" target="_blank">https://github.com/martine/ninja</a>>`_<br>
-build system instead of make. It is aimed at making your builds faster.<br>
-Currently this step will require building Ninja from sources and using a<br>
-development version of CMake.<br>
-<br>
-To take advantage of using Clang Tools along with Ninja build you need<br>
-at least CMake 2.8.9. At the moment CMake 2.8.9 is still under<br>
-development, so you can get latest development sources and build it<br>
-yourself:<br>
-<br>
-.. code-block:: console<br>
-<br>
- $ git clone git://<a href="http://cmake.org/cmake.git" target="_blank">cmake.org/cmake.git</a><br>
- $ cd cmake<br>
- $ ./bootstrap<br>
- $ make<br>
- $ sudo make install<br>
-<br>
-Having the correct version of CMake, you can clone the Ninja git<br>
-repository and build Ninja from sources:<br>
-<br>
-.. code-block:: console<br>
-<br>
- $ git clone git://<a href="http://github.com/martine/ninja.git" target="_blank">github.com/martine/ninja.git</a><br>
- $ cd ninja/<br>
- $ ./bootstrap.py<br>
-<br>
-This will result in a single binary ``ninja`` in the current directory.<br>
-It doesn't require installation and can just be copied to any location<br>
-inside ``$PATH``, say ``/usr/local/bin/``:<br>
-<br>
-.. code-block:: console<br>
-<br>
- $ sudo cp ninja /usr/local/bin/<br>
- $ sudo chmod a+rx /usr/local/bin/ninja<br>
-<br>
-After doing all of this, you'll need to generate Ninja build files for<br>
-LLVM with CMake. You need to make a build directory and run CMake from<br>
-it:<br>
-<br>
-.. code-block:: console<br>
-<br>
- $ mkdir your/build/directory<br>
- $ cd your/build/directory<br>
- $ cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON path/to/llvm/sources<br>
-<br>
-If you want to use clang instead of GCC, you can add<br>
-``-DCMAKE_C_COMPILER=/path/to/clang -DCMAKE_CXX_COMPILER=/path/to/clang++``.<br>
-You can also use ``ccmake``, which provides a curses interface to configure<br>
-CMake variables in an interactive manner.<br>
-<br>
-As a result, the new ``compile_commands.json`` file should appear in the<br>
-current directory. You should link it to the LLVM source tree so that<br>
-Clang Tooling is able to use it:<br>
-<br>
-.. code-block:: console<br>
-<br>
- $ ln -s $PWD/compile_commands.json path/to/llvm/source/<br>
-<br>
-Now you are ready to build and test LLVM using Ninja:<br>
-<br>
-.. code-block:: console<br>
-<br>
- $ ninja check-all<br>
-<br>
-Other target names can be used in the same way as with make.<br>
-<br>
+===================================<br>
+How To Setup Clang Tooling For LLVM<br>
+===================================<br>
+<br>
+Clang Tooling provides infrastructure to write tools that need syntactic<br>
+and semantic information about a program. This term also relates to a set<br>
+of specific tools using this infrastructure (e.g. ``clang-check``). This<br>
+document provides information on how to set up and use Clang Tooling for<br>
+the LLVM source code.<br>
+<br>
+Introduction<br>
+============<br>
+<br>
+Clang Tooling needs a compilation database to figure out specific build<br>
+options for each file. Currently it can create a compilation database<br>
+from the ``compilation_commands.json`` file, generated by CMake. When<br>
+invoking clang tools, you can either specify a path to a build directory<br>
+using a command line parameter ``-p`` or let Clang Tooling find this<br>
+file in your source tree. In either case you need to configure your<br>
+build using CMake to use clang tools.<br>
+<br>
+Setup Clang Tooling Using CMake and Make<br>
+========================================<br>
+<br>
+If you intend to use make to build LLVM, you should have CMake 2.8.6 or<br>
+later installed (can be found `here <<a href="http://cmake.org" target="_blank">http://cmake.org</a>>`_).<br>
+<br>
+First, you need to generate Makefiles for LLVM with CMake. You need to<br>
+make a build directory and run CMake from it:<br>
+<br>
+.. code-block:: console<br>
+<br>
+ $ mkdir your/build/directory<br>
+ $ cd your/build/directory<br>
+ $ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON path/to/llvm/sources<br>
+<br>
+If you want to use clang instead of GCC, you can add<br>
+``-DCMAKE_C_COMPILER=/path/to/clang -DCMAKE_CXX_COMPILER=/path/to/clang++``.<br>
+You can also use ``ccmake``, which provides a curses interface to configure<br>
+CMake variables for lazy people.<br>
+<br>
+As a result, the new ``compile_commands.json`` file should appear in the<br>
+current directory. You should link it to the LLVM source tree so that<br>
+Clang Tooling is able to use it:<br>
+<br>
+.. code-block:: console<br>
+<br>
+ $ ln -s $PWD/compile_commands.json path/to/llvm/source/<br>
+<br>
+Now you are ready to build and test LLVM using make:<br>
+<br>
+.. code-block:: console<br>
+<br>
+ $ make check-all<br>
+<br>
+Using Clang Tools<br>
+=================<br>
+<br>
+After you completed the previous steps, you are ready to run clang tools. If<br>
+you have a recent clang installed, you should have ``clang-check`` in<br>
+``$PATH``. Try to run it on any ``.cpp`` file inside the LLVM source tree:<br>
+<br>
+.. code-block:: console<br>
+<br>
+ $ clang-check tools/clang/lib/Tooling/CompilationDatabase.cpp<br>
+<br>
+If you're using vim, it's convenient to have clang-check integrated. Put<br>
+this into your ``.vimrc``:<br>
+<br>
+::<br>
+<br>
+ function! ClangCheckImpl(cmd)<br>
+ if &autowrite | wall | endif<br>
+ echo "Running " . a:cmd . " ..."<br>
+ let l:output = system(a:cmd)<br>
+ cexpr l:output<br>
+ cwindow<br>
+ let w:quickfix_title = a:cmd<br>
+ if v:shell_error != 0<br>
+ cc<br>
+ endif<br>
+ let g:clang_check_last_cmd = a:cmd<br>
+ endfunction<br>
+<br>
+ function! ClangCheck()<br>
+ let l:filename = expand('%')<br>
+ if l:filename =~ '\.\(cpp\|cxx\|cc\|c\)$'<br>
+ call ClangCheckImpl("clang-check " . l:filename)<br>
+ elseif exists("g:clang_check_last_cmd")<br>
+ call ClangCheckImpl(g:clang_check_last_cmd)<br>
+ else<br>
+ echo "Can't detect file's compilation arguments and no previous clang-check invocation!"<br>
+ endif<br>
+ endfunction<br>
+<br>
+ nmap <silent> <F5> :call ClangCheck()<CR><CR><br>
+<br>
+When editing a .cpp/.cxx/.cc/.c file, hit F5 to reparse the file. In<br>
+case the current file has a different extension (for example, .h), F5<br>
+will re-run the last clang-check invocation made from this vim instance<br>
+(if any). The output will go into the error window, which is opened<br>
+automatically when clang-check finds errors, and can be re-opened with<br>
+``:cope``.<br>
+<br>
+Other ``clang-check`` options that can be useful when working with clang<br>
+AST:<br>
+<br>
+* ``-ast-print`` --- Build ASTs and then pretty-print them.<br>
+* ``-ast-dump`` --- Build ASTs and then debug dump them.<br>
+* ``-ast-dump-filter=<string>`` --- Use with ``-ast-dump`` or ``-ast-print`` to<br>
+ dump/print only AST declaration nodes having a certain substring in a<br>
+ qualified name. Use ``-ast-list`` to list all filterable declaration node<br>
+ names.<br>
+* ``-ast-list`` --- Build ASTs and print the list of declaration node qualified<br>
+ names.<br>
+<br>
+Examples:<br>
+<br>
+.. code-block:: console<br>
+<br>
+ $ clang-check tools/clang/tools/clang-check/ClangCheck.cpp -ast-dump -ast-dump-filter ActionFactory::newASTConsumer<br>
+ Processing: tools/clang/tools/clang-check/ClangCheck.cpp.<br>
+ Dumping ::ActionFactory::newASTConsumer:<br>
+ clang::ASTConsumer *newASTConsumer() (CompoundStmt 0x44da290 </home/alexfh/local/llvm/tools/clang/tools/clang-check/ClangCheck.cpp:64:40, line:72:3><br>
+ (IfStmt 0x44d97c8 <line:65:5, line:66:45><br>
+ <<<NULL>>><br>
+ (ImplicitCastExpr 0x44d96d0 <line:65:9> '_Bool':'_Bool' <UserDefinedConversion><br>
+ ...<br>
+ $ clang-check tools/clang/tools/clang-check/ClangCheck.cpp -ast-print -ast-dump-filter ActionFactory::newASTConsumer<br>
+ Processing: tools/clang/tools/clang-check/ClangCheck.cpp.<br>
+ Printing <anonymous namespace>::ActionFactory::newASTConsumer:<br>
+ clang::ASTConsumer *newASTConsumer() {<br>
+ if (this->ASTList.operator _Bool())<br>
+ return clang::CreateASTDeclNodeLister();<br>
+ if (this->ASTDump.operator _Bool())<br>
+ return clang::CreateASTDumper(this->ASTDumpFilter);<br>
+ if (this->ASTPrint.operator _Bool())<br>
+ return clang::CreateASTPrinter(&llvm::outs(), this->ASTDumpFilter);<br>
+ return new clang::ASTConsumer();<br>
+ }<br>
+<br>
+(Experimental) Using Ninja Build System<br>
+=======================================<br>
+<br>
+Optionally you can use the `Ninja <<a href="https://github.com/martine/ninja" target="_blank">https://github.com/martine/ninja</a>>`_<br>
+build system instead of make. It is aimed at making your builds faster.<br>
+Currently this step will require building Ninja from sources.<br>
+<br>
+To take advantage of using Clang Tools along with Ninja build you need<br>
+at least CMake 2.8.9.<br>
+<br>
+Clone the Ninja git repository and build Ninja from sources:<br>
+<br>
+.. code-block:: console<br>
+<br>
+ $ git clone git://<a href="http://github.com/martine/ninja.git" target="_blank">github.com/martine/ninja.git</a><br>
+ $ cd ninja/<br>
+ $ ./bootstrap.py<br>
+<br>
+This will result in a single binary ``ninja`` in the current directory.<br>
+It doesn't require installation and can just be copied to any location<br>
+inside ``$PATH``, say ``/usr/local/bin/``:<br>
+<br>
+.. code-block:: console<br>
+<br>
+ $ sudo cp ninja /usr/local/bin/<br>
+ $ sudo chmod a+rx /usr/local/bin/ninja<br>
+<br>
+After doing all of this, you'll need to generate Ninja build files for<br>
+LLVM with CMake. You need to make a build directory and run CMake from<br>
+it:<br>
+<br>
+.. code-block:: console<br>
+<br>
+ $ mkdir your/build/directory<br>
+ $ cd your/build/directory<br>
+ $ cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON path/to/llvm/sources<br>
+<br>
+If you want to use clang instead of GCC, you can add<br>
+``-DCMAKE_C_COMPILER=/path/to/clang -DCMAKE_CXX_COMPILER=/path/to/clang++``.<br>
+You can also use ``ccmake``, which provides a curses interface to configure<br>
+CMake variables in an interactive manner.<br>
+<br>
+As a result, the new ``compile_commands.json`` file should appear in the<br>
+current directory. You should link it to the LLVM source tree so that<br>
+Clang Tooling is able to use it:<br>
+<br>
+.. code-block:: console<br>
+<br>
+ $ ln -s $PWD/compile_commands.json path/to/llvm/source/<br>
+<br>
+Now you are ready to build and test LLVM using Ninja:<br>
+<br>
+.. code-block:: console<br>
+<br>
+ $ ninja check-all<br>
+<br>
+Other target names can be used in the same way as with make.<br>
+<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote></div>