llvm-project/clang/lib/Tooling/Refactoring
David L. Jones 4ed5521cad [Tooling] Add a hack to work around issues with matcher binding in r368681.
The change in r368681 contains a (probably unintentional) behavioral change for
rewrite rules with a single matcher. Previously, the single matcher would not
need to be bound (`joinCaseMatchers` returned it directly), even though a final
DynTypeMatcher was created and bound by `buildMatcher`. With the new change, a
single matcher will be bound, in addition to the final binding (which is now in
`buildMatchers`, but happens roughly at the same point in the overall flow).

This patch simply duplicates the "final matcher" trick: it creates an extra
DynTypedMatcher for each rewrite rule case matcher, and unconditionally makes it
bindable. This is probably not the right long-term fix, but it does allow
existing code to continue to work with this interface.

Subscribers: cfe-commits, gribozavr, ymandel

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66273

llvm-svn: 368958
2019-08-15 04:10:11 +00:00
..
Extract [Tooling] Added DeclStmtClass to ExtractionSemicolonPolicy 2019-08-14 13:37:39 +00:00
Rename [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
ASTSelection.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ASTSelectionRequirements.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
AtomicChange.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt Rename clangToolingRefactor to clangToolingRefactoring for consistency with its directory 2019-05-25 00:27:19 +00:00
RangeSelector.cpp [LibTooling] Add `before` and `after` selectors for selecting point-ranges relative to nodes. 2019-05-29 12:40:36 +00:00
RefactoringActions.cpp [Clang] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:04:18 +00:00
SourceCode.cpp [LibTooling] Add function to translate and validate source range for editing 2019-07-18 17:26:57 +00:00
Stencil.cpp [LibTooling] Update Stencil to use RangeSelector 2019-05-22 18:03:00 +00:00
Transformer.cpp [Tooling] Add a hack to work around issues with matcher binding in r368681. 2019-08-15 04:10:11 +00:00