[clangd] NFC: Prefer `isa<>` to `dyn_cast<>` to do the checking.

Summary: Prefer `isa<>` to `dyn_cast<>` when there only need a checking.

Reviewers: ilya-biryukov, MaskRay

Reviewed By: ilya-biryukov, MaskRay

Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits, MTC

Differential Revision: https://reviews.llvm.org/D54878

llvm-svn: 347635
This commit is contained in:
Henry Wong 2018-11-27 04:27:00 +00:00
parent 0bbbc55182
commit 1a1fbdc6ef
1 changed files with 2 additions and 2 deletions

View File

@ -95,11 +95,11 @@ std::string printName(const ASTContext &Ctx, const NamedDecl &ND) {
return Out.str();
}
// The name was empty, so present an anonymous entity.
if (llvm::dyn_cast<NamespaceDecl>(&ND))
if (isa<NamespaceDecl>(ND))
return "(anonymous namespace)";
if (auto *Cls = llvm::dyn_cast<RecordDecl>(&ND))
return ("(anonymous " + Cls->getKindName() + ")").str();
if (llvm::dyn_cast<EnumDecl>(&ND))
if (isa<EnumDecl>(ND))
return "(anonymous enum)";
return "(anonymous)";
}