summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/RefactoringCallbacks.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Tooling/RefactoringCallbacks.cpp')
-rw-r--r--clang/lib/Tooling/RefactoringCallbacks.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Tooling/RefactoringCallbacks.cpp b/clang/lib/Tooling/RefactoringCallbacks.cpp
index af25fd87b26..ccc67c44ae9 100644
--- a/clang/lib/Tooling/RefactoringCallbacks.cpp
+++ b/clang/lib/Tooling/RefactoringCallbacks.cpp
@@ -39,7 +39,7 @@ ReplaceStmtWithText::ReplaceStmtWithText(StringRef FromId, StringRef ToText)
void ReplaceStmtWithText::run(
const ast_matchers::MatchFinder::MatchResult &Result) {
- if (const Stmt *FromMatch = Result.Nodes.getStmtAs<Stmt>(FromId)) {
+ if (const Stmt *FromMatch = Result.Nodes.getNodeAs<Stmt>(FromId)) {
auto Err = Replace.add(tooling::Replacement(
*Result.SourceManager,
CharSourceRange::getTokenRange(FromMatch->getSourceRange()), ToText));
@@ -56,8 +56,8 @@ ReplaceStmtWithStmt::ReplaceStmtWithStmt(StringRef FromId, StringRef ToId)
void ReplaceStmtWithStmt::run(
const ast_matchers::MatchFinder::MatchResult &Result) {
- const Stmt *FromMatch = Result.Nodes.getStmtAs<Stmt>(FromId);
- const Stmt *ToMatch = Result.Nodes.getStmtAs<Stmt>(ToId);
+ const Stmt *FromMatch = Result.Nodes.getNodeAs<Stmt>(FromId);
+ const Stmt *ToMatch = Result.Nodes.getNodeAs<Stmt>(ToId);
if (FromMatch && ToMatch) {
auto Err = Replace.add(
replaceStmtWithStmt(*Result.SourceManager, *FromMatch, *ToMatch));
@@ -75,7 +75,7 @@ ReplaceIfStmtWithItsBody::ReplaceIfStmtWithItsBody(StringRef Id,
void ReplaceIfStmtWithItsBody::run(
const ast_matchers::MatchFinder::MatchResult &Result) {
- if (const IfStmt *Node = Result.Nodes.getStmtAs<IfStmt>(Id)) {
+ if (const IfStmt *Node = Result.Nodes.getNodeAs<IfStmt>(Id)) {
const Stmt *Body = PickTrueBranch ? Node->getThen() : Node->getElse();
if (Body) {
auto Err =
OpenPOWER on IntegriCloud