Commit Graph
6 Commits
Author SHA1 Message Date
Jon Meow 6fa42a7f3c For-range in replacement logic (#631)
This replaces GetAstMatcher with AddMatcher because cxxForRangeStmt is a StatementMatcher. addMatcher has multiple definitions (https://clang.llvm.org/doxygen/classclang_1_1ast__matchers_1_1MatchFinder.html) and so this approach allows using the right addMatcher without writing per-call overloads.

To handle the `var`, I'm considering something like moving VarDecl logic into a VarMatcherBase so that I can just use CXXForRangeStmt's getLoopVariable. The problem is a for-range statement has multiple VarDecls, and getLoopVariable may be the easiest way to identify the real one.
2021-07-12 16:20:44 -07:00
Jon Meow 4f1b2198ff Refactor Matcher code to reduce per-Matcher boilerplate (#615)
This is in part to eliminate the "sm" and "lang_opts" variables that received comment, but also cuts back on the use of auto.
2021-07-08 12:42:24 -07:00
Jon MeowandGeoff Romer e7a1093eb9 Fix fn placement around keywords (#613)
Co-authored-by: Geoff Romer <gromer@google.com>
2021-07-01 09:43:14 -07:00
Jon Meow 9bdabda851 Insert fn for void functions (#596) 2021-06-24 10:16:21 -07:00
Jon Meow f180c64454 Change how replacements are filtered (#541)
This replaces the use of `isExpansionInMainFile` with instead taking the list of input files, and only touching them. This doesn't keep `isExpansionInMainFile` because it should be redundant, and as such it'd be easy to forget. Unless it starts being a performance issue, it's probably better to omit.
2021-06-03 16:35:55 -07:00
Jon Meow 29bf305539 Add tests to the cpp_refactoring tool. (#539)
This refactors the main.cpp out into a file structure that should make it easier to add more matchers/tests.
2021-05-17 16:55:50 -07:00