aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/CodeCompleteConsumer.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2020-11-15 12:56:32 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2020-11-15 12:58:36 +0000
commit5e373b2e94d714a7250e961029a58bae5585f33e (patch)
tree4b22c34b21cff34135cb61658d2f248a14857530 /clang/lib/Sema/CodeCompleteConsumer.cpp
parent906220b5e9b3fc642c4b6c6401936c8f32e0e0d9 (diff)
downloadllvm-5e373b2e94d714a7250e961029a58bae5585f33e.zip
llvm-5e373b2e94d714a7250e961029a58bae5585f33e.tar.gz
llvm-5e373b2e94d714a7250e961029a58bae5585f33e.tar.bz2
[Sema] Use isa<> instead of dyn_cast<> as pointer is never dereferenced. NFCI.
We are only checking for the class type. Fixes Wshadow warnings.
Diffstat (limited to 'clang/lib/Sema/CodeCompleteConsumer.cpp')
-rw-r--r--clang/lib/Sema/CodeCompleteConsumer.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Sema/CodeCompleteConsumer.cpp b/clang/lib/Sema/CodeCompleteConsumer.cpp
index f1ad8ae..678a09b 100644
--- a/clang/lib/Sema/CodeCompleteConsumer.cpp
+++ b/clang/lib/Sema/CodeCompleteConsumer.cpp
@@ -356,8 +356,7 @@ const char *CodeCompletionAllocator::CopyString(const Twine &String) {
}
StringRef CodeCompletionTUInfo::getParentName(const DeclContext *DC) {
- const NamedDecl *ND = dyn_cast<NamedDecl>(DC);
- if (!ND)
+ if (!isa<NamedDecl>(DC))
return {};
// Check whether we've already cached the parent name.
@@ -470,8 +469,7 @@ void CodeCompletionBuilder::addParentContext(const DeclContext *DC) {
if (DC->isFunctionOrMethod())
return;
- const NamedDecl *ND = dyn_cast<NamedDecl>(DC);
- if (!ND)
+ if (!isa<NamedDecl>(DC))
return;
ParentName = getCodeCompletionTUInfo().getParentName(DC);