[PATCH] D54878: [clangd] NFC: Prefer `isa<>` to `dyn_cast<>` to do the checking.
Phabricator via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 26 20:31:03 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rCTE347635: [clangd] NFC: Prefer `isa<>` to `dyn_cast<>` to do the checking. (authored by henrywong, committed by ).
Repository:
rCTE Clang Tools Extra
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D54878/new/
https://reviews.llvm.org/D54878
Files:
clangd/AST.cpp
Index: clangd/AST.cpp
===================================================================
--- clangd/AST.cpp
+++ clangd/AST.cpp
@@ -95,11 +95,11 @@
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)";
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54878.175388.patch
Type: text/x-patch
Size: 583 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181127/108b50f0/attachment.bin>
More information about the cfe-commits
mailing list