andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 1 | # Clang Tool Refactoring |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 2 | |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 3 | [TOC] |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 4 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 5 | ## Introduction |
| 6 | |
| 7 | Clang tools can help with global refactorings of Chromium code. Clang tools can |
| 8 | take advantage of clang's AST to perform refactorings that would be impossible |
| 9 | with a traditional find-and-replace regexp: |
| 10 | |
| 11 | * Constructing `scoped_ptr<T>` from `NULL`: <https://crbug.com/173286> |
| 12 | * Implicit conversions of `scoped_refptr<T>` to `T*`: <https://crbug.com/110610> |
| 13 | * Rename everything in Blink to follow Chromium style: <https://crbug.com/563793> |
jdoerrie | 8c5b825 | 2017-10-14 06:28:58 | [diff] [blame] | 14 | * Clean up of deprecated `base::Value` APIs: <https://crbug.com/581865> |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 15 | |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 16 | ## Caveats |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 17 | |
Daniel Cheng | 69413be | 2017-10-24 01:23:57 | [diff] [blame] | 18 | * Invocations of a clang tool runs on on only one build config at a time. For |
| 19 | example, running the tool across a `target_os="win"` build won't update code |
| 20 | that is guarded by `OS_POSIX`. Performing a global refactoring will often |
| 21 | require running the tool once for each build config. |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 22 | |
| 23 | ## Prerequisites |
| 24 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 25 | A Chromium checkout created with `fetch` should have everything needed. |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 26 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 27 | For convenience, add `third_party/llvm-build/Release+Asserts/bin` to `$PATH`. |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 28 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 29 | ## Writing the tool |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 30 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 31 | LLVM uses C++11 and CMake. Source code for Chromium clang tools lives in |
Daniel Cheng | 69413be | 2017-10-24 01:23:57 | [diff] [blame] | 32 | [//tools/clang]. It is generally easiest to use one of the already-written tools |
Devon Loehr | 3b59be9 | 2025-03-10 14:16:16 | [diff] [blame] | 33 | as the base for writing a new tool; the tool in [//tools/clang/ast_rewriter] is |
| 34 | designed for this purpose, and includes explanations its major parts. |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 35 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 36 | Chromium clang tools generally follow this pattern: |
| 37 | |
Daniel Cheng | 69413be | 2017-10-24 01:23:57 | [diff] [blame] | 38 | 1. Instantiate a |
| 39 | [`clang::ast_matchers::MatchFinder`][clang-docs-match-finder]. |
Devon Loehr | 3b59be9 | 2025-03-10 14:16:16 | [diff] [blame] | 40 | 2. Develop one or most [AST matchers][clang-matcher-tutorial] to locate the |
| 41 | patterns of interest. |
| 42 | 1. `clang-query` is of great use for this part |
| 43 | 3. Create a subclass of |
Daniel Cheng | 69413be | 2017-10-24 01:23:57 | [diff] [blame] | 44 | [`clang::ast_matchers::MatchFinder::MatchCallback`][clang-docs-match-callback] |
Devon Loehr | 3b59be9 | 2025-03-10 14:16:16 | [diff] [blame] | 45 | to determine what actions to take on each match, and register it with |
| 46 | `addMatcher()`. |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 47 | 3. Create a new `clang::tooling::FrontendActionFactory` from the `MatchFinder`. |
| 48 | 4. Run the action across the specified files with |
Daniel Cheng | 69413be | 2017-10-24 01:23:57 | [diff] [blame] | 49 | [`clang::tooling::ClangTool::run`][clang-docs-clang-tool-run]. |
| 50 | 5. Serialize generated [`clang::tooling::Replacement`][clang-docs-replacement]s |
danakj | ef9f1fa | 2016-01-16 00:37:28 | [diff] [blame] | 51 | to `stdout`. |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 52 | |
Devon Loehr | 3b59be9 | 2025-03-10 14:16:16 | [diff] [blame] | 53 | Useful references when writing the tool: |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 54 | |
Daniel Cheng | 69413be | 2017-10-24 01:23:57 | [diff] [blame] | 55 | * [Clang doxygen reference][clang-docs] |
| 56 | * [Tutorial for building tools using LibTooling and |
| 57 | LibASTMatchers][clang-tooling-tutorial] |
Devon Loehr | 3b59be9 | 2025-03-10 14:16:16 | [diff] [blame] | 58 | * [Tutorial for AST matchers][clang-matcher-tutorial] |
| 59 | * [AST matcher reference][matcher-reference] |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 60 | |
| 61 | ### Edit serialization format |
Devon Loehr | 3b59be9 | 2025-03-10 14:16:16 | [diff] [blame] | 62 | Tools do not directly edit files; rather, they output a series of _edits_ to be |
| 63 | applied later, which have the following format: |
| 64 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 65 | ``` |
| 66 | ==== BEGIN EDITS ==== |
Lukasz Anforowicz | e4d0e92f | 2020-05-06 20:47:12 | [diff] [blame] | 67 | r:::path/to/file/to/edit:::offset1:::length1:::replacement text |
| 68 | r:::path/to/file/to/edit:::offset2:::length2:::replacement text |
| 69 | r:::path/to/file2/to/edit:::offset3:::length3:::replacement text |
| 70 | include-user-header:::path/to/file2/to/edit:::-1:::-1:::header/file/to/include.h |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 71 | |
| 72 | ... |
| 73 | |
| 74 | ==== END EDITS ==== |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 75 | ``` |
| 76 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 77 | The header and footer are required. Each line between the header and footer |
| 78 | represents one edit. Fields are separated by `:::`, and the first field must |
Lukasz Anforowicz | e4d0e92f | 2020-05-06 20:47:12 | [diff] [blame] | 79 | be `r` (for replacement) or `include-user-header`. |
| 80 | A deletion is an edit with no replacement text. |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 81 | |
lukasza | f9b89e7 | 2016-12-28 19:43:06 | [diff] [blame] | 82 | The edits are applied by [`apply_edits.py`](#Running), which understands certain |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 83 | conventions: |
| 84 | |
lukasza | f9b89e7 | 2016-12-28 19:43:06 | [diff] [blame] | 85 | * The clang tool should munge newlines in replacement text to `\0`. The script |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 86 | knows to translate `\0` back to newlines when applying edits. |
| 87 | * When removing an element from a 'list' (e.g. function parameters, |
lukasza | f9b89e7 | 2016-12-28 19:43:06 | [diff] [blame] | 88 | initializers), the clang tool should emit a deletion for just the element. |
| 89 | The script understands how to extend the deletion to remove commas, etc. as |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 90 | needed. |
| 91 | |
| 92 | TODO: Document more about `SourceLocation` and how spelling loc differs from |
| 93 | expansion loc, etc. |
| 94 | |
| 95 | ### Why not RefactoringTool? |
danakj | ef9f1fa | 2016-01-16 00:37:28 | [diff] [blame] | 96 | While clang has a [`clang::tooling::RefactoringTool`](http://clang.llvm.org/doxygen/classclang_1_1tooling_1_1RefactoringTool.html) |
| 97 | to automatically apply the generated replacements and save the results, it |
| 98 | doesn't work well for Chromium: |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 99 | |
Daniel Cheng | 82f80d6 | 2017-05-18 05:39:38 | [diff] [blame] | 100 | * Clang tools run actions serially, so run time scales poorly to tens of |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 101 | thousands of files. |
| 102 | * A parsing error in any file (quite common in NaCl source) prevents any of |
| 103 | the generated replacements from being applied. |
| 104 | |
| 105 | ## Building |
| 106 | Synopsis: |
danakj | ef9f1fa | 2016-01-16 00:37:28 | [diff] [blame] | 107 | |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 108 | ```shell |
Victor Vianna | 1e01b5e | 2023-10-12 17:04:42 | [diff] [blame] | 109 | tools/clang/scripts/build.py --bootstrap --without-android --without-fuchsia \ |
dcheng | f239071 | 2017-01-05 06:41:45 | [diff] [blame] | 110 | --extra-tools rewrite_to_chrome_style |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 111 | ``` |
danakj | ef9f1fa | 2016-01-16 00:37:28 | [diff] [blame] | 112 | |
Daniel Cheng | 69413be | 2017-10-24 01:23:57 | [diff] [blame] | 113 | Running this command builds the [Oilpan plugin][//tools/clang/blink_gc_plugin], |
| 114 | the [Chrome style plugin][//tools/clang/plugins], and the [Blink to Chrome style |
| 115 | rewriter][//tools/clang/rewrite_to_chrome_style]. Additional arguments to |
Devon Loehr | 3b59be9 | 2025-03-10 14:16:16 | [diff] [blame] | 116 | `--extra-tools` should be the name of subdirectories in [//tools/clang]. The |
| 117 | tool binary will be located in `third_party/llvm-build/Release+Asserts/bin`. |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 118 | |
danakj | 30d0f8c9 | 2016-01-28 00:26:33 | [diff] [blame] | 119 | It is important to use --bootstrap as there appear to be [bugs](https://crbug.com/580745) |
| 120 | in the clang library this script produces if you build it with gcc, which is the default. |
| 121 | |
vabr | 9ed3f43 | 2017-06-09 07:30:42 | [diff] [blame] | 122 | Once clang is bootsrapped, incremental builds can be done by invoking `ninja` in |
| 123 | the `third_party/llvm-build/Release+Asserts` directory. In particular, |
| 124 | recompiling solely the tool you are writing can be accomplished by executing |
| 125 | `ninja rewrite_to_chrome_style` (replace `rewrite_to_chrome_style` with your |
| 126 | tool's name). |
| 127 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 128 | ## Running |
qyearsley | c0dc6f4 | 2016-12-02 22:13:39 | [diff] [blame] | 129 | First, build all Chromium targets to avoid failures due to missing dependencies |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 130 | that are generated as part of the build: |
danakj | ef9f1fa | 2016-01-16 00:37:28 | [diff] [blame] | 131 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 132 | ```shell |
danakj | ca6b31b5 | 2016-12-22 22:05:53 | [diff] [blame] | 133 | ninja -C out/Debug # For non-Windows |
| 134 | ninja -d keeprsp -C out/Debug # For Windows |
lukasza | f9b89e7 | 2016-12-28 19:43:06 | [diff] [blame] | 135 | |
| 136 | # experimental alternative: |
Yannic Bonenberger | 748bb0d | 2018-07-02 21:10:06 | [diff] [blame] | 137 | $gen_targets = $(ninja -C out/Debug -t targets all \ |
lukasza | f9b89e7 | 2016-12-28 19:43:06 | [diff] [blame] | 138 | | grep '^gen/[^: ]*\.[ch][pc]*:' \ |
Yannic Bonenberger | 748bb0d | 2018-07-02 21:10:06 | [diff] [blame] | 139 | | cut -f 1 -d :) |
lukasza | f9b89e7 | 2016-12-28 19:43:06 | [diff] [blame] | 140 | ninja -C out/Debug $gen_targets |
danakj | ca6b31b5 | 2016-12-22 22:05:53 | [diff] [blame] | 141 | ``` |
| 142 | |
Kevin McNee | d93068c | 2021-11-25 00:59:34 | [diff] [blame] | 143 | Note that running the clang tool with precompiled headers enabled currently |
| 144 | produces errors. This can be avoided by setting |
| 145 | `enable_precompiled_headers = false` in the build's gn args. |
| 146 | |
lukasza | f9b89e7 | 2016-12-28 19:43:06 | [diff] [blame] | 147 | Then run the actual clang tool to generate a list of edits: |
Daniel Cheng | 9ce2a30 | 2016-01-16 01:17:57 | [diff] [blame] | 148 | |
| 149 | ```shell |
Daniel Cheng | 51c5530 | 2017-05-04 00:39:16 | [diff] [blame] | 150 | tools/clang/scripts/run_tool.py --tool <path to tool> \ |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 151 | --generate-compdb |
Daniel Cheng | 51c5530 | 2017-05-04 00:39:16 | [diff] [blame] | 152 | -p out/Debug <path 1> <path 2> ... >/tmp/list-of-edits.debug |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 153 | ``` |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 154 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 155 | `--generate-compdb` can be omitted if the compile DB was already generated and |
| 156 | the list of build flags and source files has not changed since generation. |
| 157 | |
Kevin McNee | d93068c | 2021-11-25 00:59:34 | [diff] [blame] | 158 | If cross-compiling, specify `--target_os`. See `gn help target_os` for |
| 159 | possible values. For example, when cross-compiling a Windows build on |
| 160 | Linux/Mac, use `--target_os=win`. |
| 161 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 162 | `<path 1>`, `<path 2>`, etc are optional arguments to filter the files to run |
lukasza | f9b89e7 | 2016-12-28 19:43:06 | [diff] [blame] | 163 | the tool against. This is helpful when sharding global refactorings into smaller |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 164 | chunks. For example, the following command will run the `empty_string` tool |
lukasza | f9b89e7 | 2016-12-28 19:43:06 | [diff] [blame] | 165 | against just the `.c`, `.cc`, `.cpp`, `.m`, `.mm` files in `//net`. Note that |
| 166 | the filtering is not applied to the *output* of the tool - the tool can emit |
Kevin McNee | d93068c | 2021-11-25 00:59:34 | [diff] [blame] | 167 | edits that apply to files outside of `//net` (i.e. edits that apply to headers |
| 168 | from `//base` that got included by source files in `//net`). |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 169 | |
| 170 | ```shell |
Daniel Cheng | 51c5530 | 2017-05-04 00:39:16 | [diff] [blame] | 171 | tools/clang/scripts/run_tool.py --tool empty_string \ |
Yannic Bonenberger | 748bb0d | 2018-07-02 21:10:06 | [diff] [blame] | 172 | --generate-compdb \ |
Daniel Cheng | 51c5530 | 2017-05-04 00:39:16 | [diff] [blame] | 173 | -p out/Debug net >/tmp/list-of-edits.debug |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 174 | ``` |
| 175 | |
lukasza | f9b89e7 | 2016-12-28 19:43:06 | [diff] [blame] | 176 | Note that some header files might only be included from generated files (e.g. |
| 177 | from only from some `.cpp` files under out/Debug/gen). To make sure that |
| 178 | contents of such header files are processed by the clang tool, the clang tool |
| 179 | needs to be run against the generated files. The only way to accomplish this |
| 180 | today is to pass `--all` switch to `run_tool.py` - this will run the clang tool |
| 181 | against all the sources from the compilation database. |
| 182 | |
| 183 | Finally, apply the edits as follows: |
| 184 | |
| 185 | ```shell |
| 186 | cat /tmp/list-of-edits.debug \ |
| 187 | | tools/clang/scripts/extract_edits.py \ |
Daniel Cheng | 51c5530 | 2017-05-04 00:39:16 | [diff] [blame] | 188 | | tools/clang/scripts/apply_edits.py -p out/Debug <path 1> <path 2> ... |
lukasza | f9b89e7 | 2016-12-28 19:43:06 | [diff] [blame] | 189 | ``` |
| 190 | |
| 191 | The apply_edits.py tool will only apply edits to files actually under control of |
| 192 | `git`. `<path 1>`, `<path 2>`, etc are optional arguments to further filter the |
| 193 | files that the edits are applied to. Note that semantics of these filters is |
| 194 | distinctly different from the arguments of `run_tool.py` filters - one set of |
| 195 | filters controls which files are edited, the other set of filters controls which |
| 196 | files the clang tool is run against. |
| 197 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 198 | ## Debugging |
| 199 | Dumping the AST for a file: |
Daniel Cheng | 9ce2a30 | 2016-01-16 01:17:57 | [diff] [blame] | 200 | |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 201 | ```shell |
Daniel Cheng | 69413be | 2017-10-24 01:23:57 | [diff] [blame] | 202 | clang++ -Xclang -ast-dump -std=c++14 foo.cc | less -R |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 203 | ``` |
| 204 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 205 | Using `clang-query` to dynamically test matchers (requires checking out |
Devon Loehr | 3b59be9 | 2025-03-10 14:16:16 | [diff] [blame] | 206 | and building [clang-tools-extra][]; this should happen automatically). |
| 207 | The binary is located in `third_party/llvm-build/Release+Asserts/bin`: |
Daniel Cheng | 9ce2a30 | 2016-01-16 01:17:57 | [diff] [blame] | 208 | |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 209 | ```shell |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 210 | clang-query -p path/to/compdb base/memory/ref_counted.cc |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 211 | ``` |
| 212 | |
Devon Loehr | 3b59be9 | 2025-03-10 14:16:16 | [diff] [blame] | 213 | If you're running it on a test file instead of a real one, the compdb is |
| 214 | optional; it will complain but it still works. Test matchers against the |
| 215 | specified file by running `match <matcher>`, or simply `m <matcher>`. Use of |
| 216 | `rlwrap` is highly recommended. |
| 217 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 218 | `printf` debugging: |
Daniel Cheng | 9ce2a30 | 2016-01-16 01:17:57 | [diff] [blame] | 219 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 220 | ```c++ |
| 221 | clang::Decl* decl = result.Nodes.getNodeAs<clang::Decl>("decl"); |
| 222 | decl->dumpColor(); |
| 223 | clang::Stmt* stmt = result.Nodes.getNodeAs<clang::Stmt>("stmt"); |
| 224 | stmt->dumpColor(); |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 225 | ``` |
Daniel Cheng | 9ce2a30 | 2016-01-16 01:17:57 | [diff] [blame] | 226 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 227 | By default, the script hides the output of the tool. The easiest way to change |
| 228 | that is to `return 1` from the `main()` function of the clang tool. |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 229 | |
| 230 | ## Testing |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 231 | Synposis: |
Daniel Cheng | 9ce2a30 | 2016-01-16 01:17:57 | [diff] [blame] | 232 | |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 233 | ```shell |
Ramin Halavati | eb3f807a | 2017-08-02 05:31:31 | [diff] [blame] | 234 | tools/clang/scripts/test_tool.py <tool name> [--apply-edits] |
andybons | 3322f76 | 2015-08-24 21:37:09 | [diff] [blame] | 235 | ``` |
andybons | 6eaa0c0d | 2015-08-26 20:12:52 | [diff] [blame] | 236 | |
dcheng | ce2375e | 2016-01-12 01:09:07 | [diff] [blame] | 237 | The name of the tool binary and the subdirectory for the tool in |
| 238 | `//tools/clang` must match. The test runner finds all files that match the |
Ramin Halavati | eb3f807a | 2017-08-02 05:31:31 | [diff] [blame] | 239 | pattern `//tools/clang/<tool name>/tests/*-original.cc`, and runs the tool |
| 240 | across those files. |
| 241 | If `--apply-edits` switch is presented, tool outputs are applied to respective |
| 242 | files and compared to the `*-expected.cc` version. If there is a mismatch, the |
| 243 | result is saved in `*-actual.cc`. |
| 244 | When `--apply-edits` switch is not presented, tool outputs are compared to |
| 245 | `*-expected.txt` and if different, the result is saved in `*-actual.txt`. Note |
| 246 | that in this case, only one test file is expected. |
Daniel Cheng | 69413be | 2017-10-24 01:23:57 | [diff] [blame] | 247 | |
John Palmer | 046f987 | 2021-05-24 01:24:56 | [diff] [blame] | 248 | [//tools/clang]: https://chromium.googlesource.com/chromium/src/+/main/tools/clang/ |
Devon Loehr | 3b59be9 | 2025-03-10 14:16:16 | [diff] [blame] | 249 | [//tools/clang/ast_rewriter]: https://chromium.googlesource.com/chromium/src/+/main/tools/clang/ast_rewriter |
Daniel Cheng | 69413be | 2017-10-24 01:23:57 | [diff] [blame] | 250 | [clang-docs-match-finder]: http://clang.llvm.org/doxygen/classclang_1_1ast__matchers_1_1MatchFinder.html |
| 251 | [clang-docs-match-callback]: http://clang.llvm.org/doxygen/classclang_1_1ast__matchers_1_1MatchFinder_1_1MatchCallback.html |
| 252 | [matcher-reference]: http://clang.llvm.org/docs/LibASTMatchersReference.html |
| 253 | [clang-docs-clang-tool-run]: http://clang.llvm.org/doxygen/classclang_1_1tooling_1_1ClangTool.html#acec91f63b45ac7ee2d6c94cb9c10dab3 |
| 254 | [clang-docs-replacement]: http://clang.llvm.org/doxygen/classclang_1_1tooling_1_1Replacement.html |
| 255 | [clang-docs]: http://clang.llvm.org/doxygen/index.html |
| 256 | [clang-tooling-tutorial]: http://clang.llvm.org/docs/LibASTMatchersTutorial.html |
John Palmer | 046f987 | 2021-05-24 01:24:56 | [diff] [blame] | 257 | [//tools/clang/blink_gc_plugin]: https://chromium.googlesource.com/chromium/src/+/main/tools/clang/blink_gc_plugin/ |
| 258 | [//tools/clang/plugins]: https://chromium.googlesource.com/chromium/src/+/main/tools/clang/plugins/ |
| 259 | [//tools/clang/rewrite_to_chrome_style]: https://chromium.googlesource.com/chromium/src/+/main/tools/clang/rewrite_to_chrome_style/ |
Devon Loehr | 3b59be9 | 2025-03-10 14:16:16 | [diff] [blame] | 260 | [clang-tools-extra]: (https://clang.llvm.org/extra/index.html) |
| 261 | [clang-matcher-tutorial]: (https://clang.llvm.org/docs/LibASTMatchers.html#astmatchers-writing) |