[Sema] Use isa<> instead of dyn_cast<> as pointer is never dereferenced. NFCI.

We are only checking for the class type. Fixes Wshadow warnings.
This commit is contained in:
Simon Pilgrim 2020-11-15 12:56:32 +00:00
parent 906220b5e9
commit 5e373b2e94
1 changed files with 2 additions and 4 deletions

View File

@ -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);