forked from OSchip/llvm-project
[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:
parent
0bbbc55182
commit
1a1fbdc6ef
|
@ -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)";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue