29 #ifndef LLVM_CLANG_TOOLING_REFACTORINGCALLBACKS_H
30 #define LLVM_CLANG_TOOLING_REFACTORINGCALLBACKS_H
57 std::map<std::string, Replacements> &FileToReplaces);
62 Callbacks.push_back(Callback);
72 std::vector<RefactoringCallback *> Callbacks;
74 std::map<std::string, Replacements> &FileToReplaces;
98 create(StringRef FromId, StringRef ToTemplate);
102 struct TemplateElement {
103 enum { Literal, Identifier }
Type;
107 std::vector<TemplateElement> Template);
109 std::vector<TemplateElement> Template;
134 const bool PickTrueBranch;
A class to allow finding matches over the Clang AST.
Replace an if-statement bound to Id with the outdented text of its body, choosing the consequent or t...
The base class of the type hierarchy.
const DynTypedMatcher *const Matcher
void addMatcher(const DeclarationMatcher &NodeMatch, MatchCallback *Action)
Adds a matcher to execute when running over the AST.
void run(const ast_matchers::MatchFinder::MatchResult &Result) override
Called on every match by the MatchFinder.
ReplaceIfStmtWithItsBody(StringRef Id, bool PickTrueBranch)
MatchFinder::MatchCallback * Callback
Contains all information for a given match.
ReplaceStmtWithText(StringRef FromId, StringRef ToText)
Replace the text of the statement bound to FromId with the text in ToText.
void run(const ast_matchers::MatchFinder::MatchResult &Result) override
Called on every match by the MatchFinder.
Called when the Match registered for it was successfully found in the AST.