OLD | NEW |
1 # Clang | 1 # Clang |
2 | 2 |
3 [Clang](http://clang.llvm.org/) is a compiler with many desirable features | 3 [Clang](http://clang.llvm.org/) is a compiler with many desirable features |
4 (outlined on their website). | 4 (outlined on their website). |
5 | 5 |
6 Chrome can be built with Clang. It is now the default compiler on Mac and Linux | 6 Chrome can be built with Clang. It is now the default compiler on Mac and Linux |
7 for building Chrome, and it is currently useful for its warning and error | 7 for building Chrome, and it is currently useful for its warning and error |
8 messages on Android and Windows. | 8 messages on Android and Windows. |
9 | 9 |
10 See | 10 See |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 * `clang_load`: Absolute path to a dynamic library containing your plugin | 62 * `clang_load`: Absolute path to a dynamic library containing your plugin |
63 * `clang_add_plugin`: tells clang to run a specific PluginASTAction | 63 * `clang_add_plugin`: tells clang to run a specific PluginASTAction |
64 | 64 |
65 So for example, you could use the plugin in this directory with: | 65 So for example, you could use the plugin in this directory with: |
66 | 66 |
67 * `GYP_DEFINES='clang=1 clang_load=/path/to/libFindBadConstructs.so | 67 * `GYP_DEFINES='clang=1 clang_load=/path/to/libFindBadConstructs.so |
68 clang_add_plugin=find-bad-constructs' gclient runhooks` | 68 clang_add_plugin=find-bad-constructs' gclient runhooks` |
69 | 69 |
70 ## Using the clang static analyzer | 70 ## Using the clang static analyzer |
71 | 71 |
72 See [clang_static_analyser.md](clang_static_analyser.md). | 72 See [clang_static_analyzer.md](clang_static_analyzer.md). |
73 | 73 |
74 ## Windows | 74 ## Windows |
75 | 75 |
76 **Experimental!** | 76 **Experimental!** |
77 | 77 |
78 clang can be used as compiler on Windows. Clang uses Visual Studio's linker and | 78 clang can be used as compiler on Windows. Clang uses Visual Studio's linker and |
79 SDK, so you still need to have Visual Studio installed. | 79 SDK, so you still need to have Visual Studio installed. |
80 | 80 |
81 Things should compile, and all tests should pass. You can check these bots for | 81 Things should compile, and all tests should pass. You can check these bots for |
82 how things are currently looking: | 82 how things are currently looking: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 You can then run `head out/Release/build.ninja` and check that the first to | 119 You can then run `head out/Release/build.ninja` and check that the first to |
120 lines set `cc` and `cxx` to your clang binary. If things look good, run `ninja | 120 lines set `cc` and `cxx` to your clang binary. If things look good, run `ninja |
121 -C out/Release` to build. | 121 -C out/Release` to build. |
122 | 122 |
123 If your clang revision is very different from the one currently used in chromium | 123 If your clang revision is very different from the one currently used in chromium |
124 | 124 |
125 * Check `tools/clang/scripts/update.sh` to find chromium's clang revision | 125 * Check `tools/clang/scripts/update.sh` to find chromium's clang revision |
126 * You might have to tweak warning flags. Or you could set `werror=` in the | 126 * You might have to tweak warning flags. Or you could set `werror=` in the |
127 line above to disable warnings as errors (but this only works on Linux). | 127 line above to disable warnings as errors (but this only works on Linux). |
OLD | NEW |