• Home
  • Raw
  • Download

Lines Matching +full:clang +full:- +full:tools +full:- +full:extra

2 Clang Plugins
5 Clang Plugins make it possible to run extra user defined actions during a
7 run a Clang Plugin.
12 Clang Plugins run FrontendActions over code. See the :doc:`FrontendAction
15 simple clang plugin.
24 .. code-block:: c++
29 if (args[i] == "-some-arg") {
42 .. code-block:: c++
44 static FrontendPluginRegistry::Add<MyPlugin> X("my-plugin-name", "my plugin description");
52 .. code-block:: c++
69 Let's look at an example plugin that prints top-level function names. This
70 example is checked into the clang repository; please take a look at
72 <http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/PrintFunctionNames.cpp?v…
79 --------------------------
82 loaded via the `-load` command line option. This will load all plugins
84 `-plugin` option. Additional parameters for the plugins can be passed with
85 `-plugin-arg-<plugin-name>`.
87 Note that those options must reach clang's cc1 process. There are two
90 * Directly call the parsing process by using the `-cc1` option; this
94 * Use clang as usual, but prefix all arguments to the cc1 process with
95 `-Xclang`.
97 For example, to run the ``print-function-names`` plugin over a source file in
98 clang, first build the plugin, and then call clang with the plugin from the
101 .. code-block:: console
105 $ clang++ -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS \
106 -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D_GNU_SOURCE \
107 -I$BD/tools/clang/include -Itools/clang/include -I$BD/include -Iinclude \
108 tools/clang/tools/clang-check/ClangCheck.cpp -fsyntax-only \
109 -Xclang -load -Xclang $BD/lib/PrintFunctionNames.so -Xclang \
110 -plugin -Xclang print-fns
112 Also see the print-function-name plugin example's
113 `README <http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/PrintFunctionNames/README.txt?view=…
116 Using the clang command line
117 ----------------------------
119 Using `-fplugin=plugin` on the clang command line passes the plugin
120 through as an argument to `-load` on the cc1 command line. If the plugin
123 action (i.e. the same as using `-add-plugin`):
125 .. code-block:: c++