From 74f40fd73d831e46c782525e25fa4a8881a081dc Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 21 Dec 2024 21:42:41 -0800 Subject: [PATCH] [clang-doc] Migrate away from PointerUnion::{is,get} (NFC) Note that PointerUnion::{is,get} have been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with // isa, cast and the llvm::dyn_cast --- clang-tools-extra/clang-doc/Serialize.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/clang-tools-extra/clang-doc/Serialize.cpp b/clang-tools-extra/clang-doc/Serialize.cpp index 93efdd44f4589..f737fc75135a1 100644 --- a/clang-tools-extra/clang-doc/Serialize.cpp +++ b/clang-tools-extra/clang-doc/Serialize.cpp @@ -696,13 +696,11 @@ emitInfo(const RecordDecl *D, const FullComment *FC, int LineNumber, // What this is a specialization of. auto SpecOf = CTSD->getSpecializedTemplateOrPartial(); - if (SpecOf.is()) { - Specialization.SpecializationOf = - getUSRForDecl(SpecOf.get()); - } else if (SpecOf.is()) { - Specialization.SpecializationOf = - getUSRForDecl(SpecOf.get()); - } + if (auto *CTD = dyn_cast(SpecOf)) + Specialization.SpecializationOf = getUSRForDecl(CTD); + else if (auto *CTPSD = + dyn_cast(SpecOf)) + Specialization.SpecializationOf = getUSRForDecl(CTPSD); // Parameters to the specilization. For partial specializations, get the // parameters "as written" from the ClassTemplatePartialSpecializationDecl