Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions pages/common/clang-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# clang-check

> A tool for basic error checking and working with Clang's Abstract Syntax Tree (AST). It is part of Clang's LibTooling and is useful for debugging and analyzing C/C++ code.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> A tool for basic error checking and working with Clang's Abstract Syntax Tree (AST). It is part of Clang's LibTooling and is useful for debugging and analyzing C/C++ code.
> Check basic erros and work with Clang's Abstract Syntax Tree (AST).
> Part of Clang's LibTooling and is useful for debugging and analyzing C/C++ code.

> More information: <https://clang.llvm.org/docs/ClangCheck.html>.

- Run default checks on a source file:

`clang-check {{path/to/file.cpp}} --`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of -- here?


- Dump the Abstract Syntax Tree for debugging:

`clang-check {{path/to/file.cpp}} -ast-dump --`

- Filter AST by Name:

`clang-check {{path/to/file.cpp}} -ast-dump -ast-dump-filter FunctionName`

- Pretty-Print AST:

`clang-check {{path/to/file.cpp}} -ast-print --`