This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL368958: [Tooling] Add a hack to work around issues with matcher binding in r368681. (authored by dlj, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits.
Changed prior to commit: https://reviews.llvm.org/D66273?vs=215316&id=215317#toc Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66273/new/ https://reviews.llvm.org/D66273 Files: cfe/trunk/lib/Tooling/Refactoring/Transformer.cpp Index: cfe/trunk/lib/Tooling/Refactoring/Transformer.cpp =================================================================== --- cfe/trunk/lib/Tooling/Refactoring/Transformer.cpp +++ cfe/trunk/lib/Tooling/Refactoring/Transformer.cpp @@ -98,8 +98,10 @@ Matchers.reserve(Cases.size()); for (const auto &Case : Cases) { std::string Tag = (TagBase + Twine(Case.first)).str(); - auto M = Case.second.Matcher.tryBind(Tag); - assert(M && "RewriteRule matchers should be bindable."); + // HACK: Many matchers are not bindable, so ensure that tryBind will work. + DynTypedMatcher BoundMatcher(Case.second.Matcher); + BoundMatcher.setAllowBind(true); + auto M = BoundMatcher.tryBind(Tag); Matchers.push_back(*std::move(M)); } return Matchers;
Index: cfe/trunk/lib/Tooling/Refactoring/Transformer.cpp =================================================================== --- cfe/trunk/lib/Tooling/Refactoring/Transformer.cpp +++ cfe/trunk/lib/Tooling/Refactoring/Transformer.cpp @@ -98,8 +98,10 @@ Matchers.reserve(Cases.size()); for (const auto &Case : Cases) { std::string Tag = (TagBase + Twine(Case.first)).str(); - auto M = Case.second.Matcher.tryBind(Tag); - assert(M && "RewriteRule matchers should be bindable."); + // HACK: Many matchers are not bindable, so ensure that tryBind will work. + DynTypedMatcher BoundMatcher(Case.second.Matcher); + BoundMatcher.setAllowBind(true); + auto M = BoundMatcher.tryBind(Tag); Matchers.push_back(*std::move(M)); } return Matchers;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits