diff options
author | Alexander Kornienko <alexfh@google.com> | 2016-12-13 16:19:34 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2016-12-13 16:19:34 +0000 |
commit | 7cdc705b03ece877a0b9753f6b30c83f8acb5178 (patch) | |
tree | 2fb7569e12e043bea1cac079ca8dbefe3b0d5650 /clang | |
parent | 9f58fe08bf08cf5b7dd2815eb9fe19158eb2f2c1 (diff) | |
download | bcm5719-llvm-7cdc705b03ece877a0b9753f6b30c83f8acb5178.tar.gz bcm5719-llvm-7cdc705b03ece877a0b9753f6b30c83f8acb5178.zip |
Remove deprecated methods ast_matchers::BoundNodes::{getStmtAs,getDeclAs}
llvm-svn: 289543
Diffstat (limited to 'clang')
-rw-r--r-- | clang/include/clang/ASTMatchers/ASTMatchers.h | 12 | ||||
-rw-r--r-- | clang/lib/Tooling/RefactoringCallbacks.cpp | 8 | ||||
-rw-r--r-- | clang/unittests/AST/DeclPrinterTest.cpp | 2 | ||||
-rw-r--r-- | clang/unittests/AST/StmtPrinterTest.cpp | 2 |
4 files changed, 6 insertions, 18 deletions
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h index ce01f45333b..f2c649aca02 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchers.h +++ b/clang/include/clang/ASTMatchers/ASTMatchers.h @@ -75,18 +75,6 @@ public: return MyBoundNodes.getNodeAs<T>(ID); } - /// \brief Deprecated. Please use \c getNodeAs instead. - /// @{ - template <typename T> - const T *getDeclAs(StringRef ID) const { - return getNodeAs<T>(ID); - } - template <typename T> - const T *getStmtAs(StringRef ID) const { - return getNodeAs<T>(ID); - } - /// @} - /// \brief Type of mapping from binding identifiers to bound nodes. This type /// is an associative container with a key type of \c std::string and a value /// type of \c clang::ast_type_traits::DynTypedNode 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 = diff --git a/clang/unittests/AST/DeclPrinterTest.cpp b/clang/unittests/AST/DeclPrinterTest.cpp index dc4f9145607..e5a09a31f69 100644 --- a/clang/unittests/AST/DeclPrinterTest.cpp +++ b/clang/unittests/AST/DeclPrinterTest.cpp @@ -45,7 +45,7 @@ public: PrintMatch() : NumFoundDecls(0) {} void run(const MatchFinder::MatchResult &Result) override { - const Decl *D = Result.Nodes.getDeclAs<Decl>("id"); + const Decl *D = Result.Nodes.getNodeAs<Decl>("id"); if (!D || D->isImplicit()) return; NumFoundDecls++; diff --git a/clang/unittests/AST/StmtPrinterTest.cpp b/clang/unittests/AST/StmtPrinterTest.cpp index bc7fd54e4ad..12b203236c9 100644 --- a/clang/unittests/AST/StmtPrinterTest.cpp +++ b/clang/unittests/AST/StmtPrinterTest.cpp @@ -45,7 +45,7 @@ public: PrintMatch() : NumFoundStmts(0) {} void run(const MatchFinder::MatchResult &Result) override { - const Stmt *S = Result.Nodes.getStmtAs<Stmt>("id"); + const Stmt *S = Result.Nodes.getNodeAs<Stmt>("id"); if (!S) return; NumFoundStmts++; |