Chromium Code Reviews| Index: tools/clang/plugins/README.chromium |
| diff --git a/tools/clang/plugins/README.chromium b/tools/clang/plugins/README.chromium |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cac90f1199c43ec4dcd9df88c7e3f36a97e07d18 |
| --- /dev/null |
| +++ b/tools/clang/plugins/README.chromium |
| @@ -0,0 +1,30 @@ |
| +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
|
| +------------------------------------------ |
| + |
| +I) Compiling |
| +------------ |
| + |
| +TODO(thakis): Explain how to compile these, since I'm not copying the clang |
| +build system here. |
| + |
| +II) Using these plugins as part of your build process |
| +----------------------------------------------------- |
| + |
| +Nico has awesomely added support to clang to run plugins, and gyp support to |
| +run them as part of the normal build process. There are now two gyp variables |
| +you can set to run a plugin: |
| + |
| + clang_load: loads a specific shared object plugin |
| + clang_add_plugin: tells clang to run a specific PluginASTAction |
| + |
| +So for example, you could use the plugin in this directory with: |
| + |
| + GYP_DEFINES='clang=1 clang_load=/path/to/libFindBadConstructs.so clang_add_plugin=find-bad-constructs' |
| + |
| +III) Writing plugins |
| +-------------------- |
| + |
| +As a utility to other plugin authors, I've written the ChromeClassTester class |
| +that you can derive from, which will call CheckChromeClass() on every |
| +class/struct encountered in a chrome header while filtering out blacklisted |
| +classes, namespaces and directories. |
|
Nico
2011/02/02 23:13:06
This should have a paragraph on "You usually don't
|