• Home
  • Raw
  • Download

Lines Matching +full:9 +full:- +full:tools

5 Clang Tooling provides infrastructure to write tools that need syntactic
7 of specific tools using this infrastructure (e.g. ``clang-check``). This
17 invoking clang tools, you can either specify a path to a build directory
18 using a command line parameter ``-p`` or let Clang Tooling find this
20 build using CMake to use clang tools.
31 .. code-block:: console
35 $ cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON path/to/llvm/sources
38 ``-DCMAKE_C_COMPILER=/path/to/clang -DCMAKE_CXX_COMPILER=/path/to/clang++``.
46 .. code-block:: console
48 $ ln -s $PWD/compile_commands.json path/to/llvm/source/
52 .. code-block:: console
54 $ make check-all
56 Using Clang Tools
59 After you completed the previous steps, you are ready to run clang tools. If
60 you have a recent clang installed, you should have ``clang-check`` in
63 .. code-block:: console
65 $ clang-check tools/clang/lib/Tooling/CompilationDatabase.cpp
67 If you're using vim, it's convenient to have clang-check integrated. Put
88 call ClangCheckImpl("clang-check " . l:filename)
92 echo "Can't detect file's compilation arguments and no previous clang-check invocation!"
100 will re-run the last clang-check invocation made from this vim instance
102 automatically when clang-check finds errors, and can be re-opened with
105 Other ``clang-check`` options that can be useful when working with clang
108 * ``-ast-print`` --- Build ASTs and then pretty-print them.
109 * ``-ast-dump`` --- Build ASTs and then debug dump them.
110 * ``-ast-dump-filter=<string>`` --- Use with ``-ast-dump`` or ``-ast-print`` to
112 qualified name. Use ``-ast-list`` to list all filterable declaration node
114 * ``-ast-list`` --- Build ASTs and print the list of declaration node qualified
119 .. code-block:: console
121 …$ clang-check tools/clang/tools/clang-check/ClangCheck.cpp -ast-dump -ast-dump-filter ActionFactor…
122 Processing: tools/clang/tools/clang-check/ClangCheck.cpp.
124 …wASTConsumer() (CompoundStmt 0x44da290 </home/alexfh/local/llvm/tools/clang/tools/clang-check/Clan…
127 (ImplicitCastExpr 0x44d96d0 <line:65:9> '_Bool':'_Bool' <UserDefinedConversion>
129 …$ clang-check tools/clang/tools/clang-check/ClangCheck.cpp -ast-print -ast-dump-filter ActionFacto…
130 Processing: tools/clang/tools/clang-check/ClangCheck.cpp.
133 if (this->ASTList.operator _Bool())
135 if (this->ASTDump.operator _Bool())
136 return clang::CreateASTDumper(this->ASTDumpFilter);
137 if (this->ASTPrint.operator _Bool())
138 return clang::CreateASTPrinter(&llvm::outs(), this->ASTDumpFilter);
149 To take advantage of using Clang Tools along with Ninja build you need
150 at least CMake 2.8.9.
154 .. code-block:: console
164 .. code-block:: console
173 .. code-block:: console
177 $ cmake -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON path/to/llvm/sources
180 ``-DCMAKE_C_COMPILER=/path/to/clang -DCMAKE_CXX_COMPILER=/path/to/clang++``.
188 .. code-block:: console
190 $ ln -s $PWD/compile_commands.json path/to/llvm/source/
194 .. code-block:: console
196 $ ninja check-all