27 From.getSourceRange()), Text);
38 : FromId(FromId), ToText(ToText) {}
51 : FromId(FromId), ToId(ToId) {}
57 if (FromMatch && ToMatch)
64 : Id(Id), PickTrueBranch(PickTrueBranch) {}
69 const Stmt *Body = PickTrueBranch ?
Node->getThen() :
Node->getElse();
72 }
else if (!PickTrueBranch) {
const T * getStmtAs(StringRef ID) const
IfStmt - This represents an if/then/else.
static CharSourceRange getTokenRange(SourceRange R)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
void run(const ast_matchers::MatchFinder::MatchResult &Result) override
Called on every match by the MatchFinder.
ReplaceIfStmtWithItsBody(StringRef Id, bool PickTrueBranch)
static StringRef getSourceText(CharSourceRange Range, const SourceManager &SM, const LangOptions &LangOpts, bool *Invalid=nullptr)
Returns a string for the source that the range encompasses.
Contains all information for a given match.
ReplaceStmtWithText(StringRef FromId, StringRef ToText)
const BoundNodes Nodes
Contains the nodes bound on the current match.
ast_type_traits::DynTypedNode Node
void run(const ast_matchers::MatchFinder::MatchResult &Result) override
Called on every match by the MatchFinder.
clang::SourceManager *const SourceManager
This class handles loading and caching of source files into memory.