clang API Documentation
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 <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. | |
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 77 of file RefactoringCallbacks.h.
| clang::tooling::ReplaceIfStmtWithItsBody::ReplaceIfStmtWithItsBody | ( | StringRef | Id, |
| bool | PickTrueBranch | ||
| ) |
Definition at line 62 of file RefactoringCallbacks.cpp.
| void clang::tooling::ReplaceIfStmtWithItsBody::run | ( | const ast_matchers::MatchFinder::MatchResult & | Result | ) | [override, virtual] |
Called on every match by the MatchFinder.
Implements clang::ast_matchers::MatchFinder::MatchCallback.
Definition at line 66 of file RefactoringCallbacks.cpp.
References clang::ast_matchers::BoundNodes::getStmtAs(), Node, clang::ast_matchers::MatchFinder::MatchResult::Nodes, clang::tooling::RefactoringCallback::Replace, clang::tooling::replaceStmtWithStmt(), clang::tooling::replaceStmtWithText(), and clang::ast_matchers::MatchFinder::MatchResult::SourceManager.