Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2611)

Unified Diff: docs/clang_tool_refactoring.md

Issue 1592853003: Fix clang tool refactoring docs formatting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/clang_tool_refactoring.md
diff --git a/docs/clang_tool_refactoring.md b/docs/clang_tool_refactoring.md
index 2b6c617a29246252f52217e83d07cd0f0f700de7..3d9c9edf5f71bfb8075948a46ca84f2e70517758 100644
--- a/docs/clang_tool_refactoring.md
+++ b/docs/clang_tool_refactoring.md
@@ -118,7 +118,8 @@ ninja -C out/Debug
```
Then run the actual tool:
-```
+
+```shell
tools/clang/scripts/run_tool.py <toolname> \
--generate-compdb
out/Debug <path 1> <path 2> ...
@@ -140,28 +141,33 @@ tools/clang/scripts/run_tool.py empty_string \
## Debugging
Dumping the AST for a file:
+
```shell
clang++ -cc1 -ast-dump foo.cc
```
Using `clang-query` to dynamically test matchers (requires checking out
and building [clang-tools-extras](https://github.com/llvm-mirror/clang-tools-extra)):
+
```shell
clang-query -p path/to/compdb base/memory/ref_counted.cc
```
`printf` debugging:
+
```c++
clang::Decl* decl = result.Nodes.getNodeAs<clang::Decl>("decl");
decl->dumpColor();
clang::Stmt* stmt = result.Nodes.getNodeAs<clang::Stmt>("stmt");
stmt->dumpColor();
```
+
By default, the script hides the output of the tool. The easiest way to change
that is to `return 1` from the `main()` function of the clang tool.
## Testing
Synposis:
+
```shell
test_tool.py <tool name>
```
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698