clang
6.0.0
|
Replace an if-statement bound to Id
with the outdented text of its body, choosing the consequent or the alternative based on whether PickTrueBranch
is true.
More...
#include "clang/Tooling/RefactoringCallbacks.h"
Public Member Functions | |
ReplaceIfStmtWithItsBody (StringRef Id, bool PickTrueBranch) | |
void | run (const ast_matchers::MatchFinder::MatchResult &Result) override |
Called on every match by the MatchFinder . More... | |
![]() | |
RefactoringCallback () | |
Replacements & | getReplacements () |
![]() | |
virtual | ~MatchCallback () |
virtual void | onStartOfTranslationUnit () |
Called at the start of each translation unit. More... | |
virtual void | onEndOfTranslationUnit () |
Called at the end of each translation unit. More... | |
virtual StringRef | getID () const |
An id used to group the matchers. More... | |
Additional Inherited Members | |
![]() | |
Replacements | Replace |
Replace an if-statement bound to Id
with the outdented text of its body, choosing the consequent or the alternative based on whether PickTrueBranch
is true.
Definition at line 127 of file RefactoringCallbacks.h.
clang::tooling::ReplaceIfStmtWithItsBody::ReplaceIfStmtWithItsBody | ( | StringRef | Id, |
bool | PickTrueBranch | ||
) |
Definition at line 123 of file RefactoringCallbacks.cpp.
|
overridevirtual |
Called on every match by the MatchFinder
.
Implements clang::ast_matchers::MatchFinder::MatchCallback.
Definition at line 127 of file RefactoringCallbacks.cpp.
References clang::tooling::Replacements::add(), clang::ast_matchers::BoundNodes::getNodeAs(), Node, clang::ast_matchers::MatchFinder::MatchResult::Nodes, clang::tooling::RefactoringCallback::Replace, clang::tooling::replaceStmtWithStmt(), clang::tooling::replaceStmtWithText(), clang::ast_matchers::MatchFinder::MatchResult::SourceManager, and clang::threadSafety::sx::toString().