OLD | NEW |
---|---|
(Empty) | |
1 Clang plugins: How to use and how to write | |
Nico
2011/02/02 23:13:06
I'd prefer this to be on the wiki page, and this R
| |
2 ------------------------------------------ | |
3 | |
4 I) Compiling | |
5 ------------ | |
6 | |
7 TODO(thakis): Explain how to compile these, since I'm not copying the clang | |
8 build system here. | |
9 | |
10 II) Using these plugins as part of your build process | |
11 ----------------------------------------------------- | |
12 | |
13 Nico has awesomely added support to clang to run plugins, and gyp support to | |
14 run them as part of the normal build process. There are now two gyp variables | |
15 you can set to run a plugin: | |
16 | |
17 clang_load: loads a specific shared object plugin | |
18 clang_add_plugin: tells clang to run a specific PluginASTAction | |
19 | |
20 So for example, you could use the plugin in this directory with: | |
21 | |
22 GYP_DEFINES='clang=1 clang_load=/path/to/libFindBadConstructs.so clang_add_plu gin=find-bad-constructs' | |
23 | |
24 III) Writing plugins | |
25 -------------------- | |
26 | |
27 As a utility to other plugin authors, I've written the ChromeClassTester class | |
28 that you can derive from, which will call CheckChromeClass() on every | |
29 class/struct encountered in a chrome header while filtering out blacklisted | |
30 classes, namespaces and directories. | |
Nico
2011/02/02 23:13:06
This should have a paragraph on "You usually don't
| |
OLD | NEW |