Using the Clang developer tools
summary
Shows how to use clang tools beyond the compiler: clang-format for consistent 80-column layouts, clang-tidy for style and automated modernize fixes, and scan-build (the static analyzer) which reports concrete issues like uninitialized-value traces. Explains the Compilation Database JSON workflow needed for accurate analysis, contrasts libclang Python bindings (easy but memory-limited at scale) with C++ libTooling/AST matchers (more powerful but less stable), and describes a Python tool built to histogram function-parameter counts — it works but required parsing full definitions and deduplicating locations.
AI-written summary · about
chapters (10)
- 0:00Introduction to Clang tools
- 1:05Clang beyond the compiler
- 2:32ClangFormat for code formatting
- 6:07Compilation database explained
- 7:49Clang static analyzer basics
- 10:00Clang-Tidy for refactoring
- 12:09Building custom tools with Clang
- 18:56Exploring Clang AST with Python
- 24:19LibTooling and AST matchers
- 26:03Conclusion and Q&A
related talks
01h 05mImprove your code with Clang Tooling
01h 01mBetter Tools in Your Clang Toolbox
52m“Tools from the C++ eco-system to save a leg”
48mTooling Intuition
01h 01mCode Analysis++
01h 24mExtending clang-tidy in the Present and in the Future
24mRefactoring Legacy Codebases with LibTooling
55mStandard C++ Toolset
