[clang-tools-extra] r286485 - [change-namespace] dyn_cast -> cast.
Eric Liu via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 10 10:15:35 PST 2016
Author: ioeric
Date: Thu Nov 10 12:15:34 2016
New Revision: 286485
URL: http://llvm.org/viewvc/llvm-project?rev=286485&view=rev
Log:
[change-namespace] dyn_cast -> cast.
Modified:
clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp
Modified: clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp?rev=286485&r1=286484&r2=286485&view=diff
==============================================================================
--- clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp (original)
+++ clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp Thu Nov 10 12:15:34 2016
@@ -404,7 +404,7 @@ void ChangeNamespaceTool::run(
clang::SourceRange VarRefRange = VarRef->getSourceRange();
replaceQualifiedSymbolInDeclContext(
Result, Context->getDeclContext(), VarRefRange.getBegin(),
- VarRefRange.getEnd(), llvm::dyn_cast<NamedDecl>(Var));
+ VarRefRange.getEnd(), llvm::cast<NamedDecl>(Var));
} else {
const auto *Call = Result.Nodes.getNodeAs<clang::CallExpr>("call");
assert(Call != nullptr && "Expecting callback for CallExpr.");
@@ -421,7 +421,7 @@ void ChangeNamespaceTool::run(
clang::SourceRange CalleeRange = Call->getCallee()->getSourceRange();
replaceQualifiedSymbolInDeclContext(
Result, Context->getDeclContext(), CalleeRange.getBegin(),
- CalleeRange.getEnd(), llvm::dyn_cast<NamedDecl>(Func));
+ CalleeRange.getEnd(), llvm::cast<NamedDecl>(Func));
}
}
@@ -543,7 +543,7 @@ void ChangeNamespaceTool::replaceQualifi
const DeclContext *DeclCtx, SourceLocation Start, SourceLocation End,
const NamedDecl *FromDecl) {
const auto *NsDeclContext = DeclCtx->getEnclosingNamespaceContext();
- const auto *NsDecl = llvm::dyn_cast<NamespaceDecl>(NsDeclContext);
+ const auto *NsDecl = llvm::cast<NamespaceDecl>(NsDeclContext);
// Calculate the name of the `NsDecl` after it is moved to new namespace.
std::string OldNs = NsDecl->getQualifiedNameAsString();
llvm::StringRef Postfix = OldNs;
More information about the cfe-commits
mailing list