diff options
author | Haojian Wu <hokein@google.com> | 2016-06-07 07:50:48 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2016-06-07 07:50:48 +0000 |
commit | e64cee81bfc7a617247c73886c81eb609258bb81 (patch) | |
tree | 91bb4627d44f1637eac822f5c5d885104dcc17f8 | |
parent | 2f90c1fedf142d36862eb479f874f186d0fd05f5 (diff) | |
download | bcm5719-llvm-e64cee81bfc7a617247c73886c81eb609258bb81.tar.gz bcm5719-llvm-e64cee81bfc7a617247c73886c81eb609258bb81.zip |
[include-fixer] Mention more details in the document.
Reviewers: bkramer
Subscribers: Eugene.Zelenko, cfe-commits, ioeric
Differential Revision: http://reviews.llvm.org/D20467
llvm-svn: 271989
-rw-r--r-- | clang-tools-extra/docs/ReleaseNotes.rst | 3 | ||||
-rw-r--r-- | clang-tools-extra/docs/include-fixer.rst | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst index 92fa22350a7..12d9dbf9e88 100644 --- a/clang-tools-extra/docs/ReleaseNotes.rst +++ b/clang-tools-extra/docs/ReleaseNotes.rst @@ -44,7 +44,8 @@ infrastructure are described first, followed by tool-specific sections. Major New Features ------------------ -- Feature1... +- :program:`clang-include-fixer`, a tool that provides an automated way of + adding ``#include`` directives for missing symbols in one translation unit. Improvements to clang-query --------------------------- diff --git a/clang-tools-extra/docs/include-fixer.rst b/clang-tools-extra/docs/include-fixer.rst index de33d6fb6c5..ea24240f8c5 100644 --- a/clang-tools-extra/docs/include-fixer.rst +++ b/clang-tools-extra/docs/include-fixer.rst @@ -41,6 +41,8 @@ database for LLVM, any project built by CMake should follow similar steps. .. code-block:: console $ cd path/to/llvm-build + $ ninja find-all-symbols // build find-all-symbols tool. + $ ninja clang-include-fixer // build clang-include-fixer tool. $ ls compile_commands.json # Make sure compile_commands.json exists. compile_commands.json $ path/to/llvm/source/tools/clang/tools/extra/include-fixer/find-all-symbols/tool/run-find-all-symbols.py @@ -48,7 +50,7 @@ database for LLVM, any project built by CMake should follow similar steps. $ ln -s $PWD/find_all_symbols_db.yaml path/to/llvm/source/ # Link database into the source tree. $ ln -s $PWD/compile_commands.json path/to/llvm/source/ # Also link compilation database if it's not there already. $ cd path/to/llvm/source - $ clang-include-fixer -db=yaml path/to/file/with/missing/include.cpp + $ /path/to/clang-include-fixer -db=yaml path/to/file/with/missing/include.cpp Added #include "foo.h" Integrate with Vim @@ -63,6 +65,14 @@ following key binding to your ``.vimrc``: This enables `clang-include-fixer` for NORMAL and VISUAL mode. Change ``,cf`` to another binding if you need clang-include-fixer on a different key. +Make sure vim can find :program:`clang-include-fixer`: + +- Add the path to :program:`clang-include-fixer` to the PATH environment variable. +- Or set ``g:clang_include_fixer_path`` in vimrc: ``let g:clang_include_fixer_path=path/to/clang-include-fixer`` + +You can customize the number of headers being shown by setting +``let g:clang_include_fixer_maximum_suggested_headers=5`` + See ``clang-include-fixer.py`` for more details. How it Works |