~/talk

Refactoring C++ Using LibTooling

Talkat emBO++ 2019 · 2019-03-14..03-17· [c-and-cpp, compilers-and-language-design]
slides:none on file

Shows how to build a real migration using clang LibTooling and clang-tidy: an AST-matcher based check finds assignments calling create_button(...) with five args and replaces them with create_button_x() plus inserted setPosition/setDimensions/setTitle calls using fix-it hints. Requires a compilation database and a clang-buildable codebase (Twitter poll: 150 people, 27% say their code doesn’t compile with clang). Covers lexer use for token/indent handling, emphasizes tests and Hyrum’s-law pitfalls, and demonstrates the check running and auto-applying fixes.

AI-written summary · about

  1. 0:00Intro
  2. 0:15What is refactoring
  3. 1:46Automated refactoring
  4. 2:09Why automate
  5. 5:03Nonatomic API Migration
  6. 7:01UI Library Example
  7. 8:23Button Example
  8. 9:33What is LibTooling
  9. 10:31Can you compile with C
  10. 12:10Build system
  11. 13:59Easy migrations
  12. 15:11Hiram Slaw
  13. 16:10Quick Summary
  14. 17:47Why ClientID
  15. 19:32Getting Started
  16. 19:58Simple AST Matchers
  17. 21:39NoMeasures
  18. 23:30Narrowing Measures
  19. 25:26Building a Simple Matter
  20. 28:11Implementing the Check
  21. 29:59Matching Operators
  22. 34:26clang
  23. 36:24check
  24. 37:15get notes
  25. 38:45catark
  26. 39:13cosmetics
  27. 40:27binary
  28. 40:57code generation
  29. 41:59fixit migrations
  30. 43:23generate diagnostic
  31. 44:44run diagnostic
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.