diff --git a/pages/common/clang-check.md b/pages/common/clang-check.md new file mode 100644 index 00000000000000..9b7eeda40bf0fa --- /dev/null +++ b/pages/common/clang-check.md @@ -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. +> More information: . + +- Run default checks on a source file: + +`clang-check {{path/to/file.cpp}} --` + +- 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 --`