From a989ce3641c80eaabca06d4e5069c1460a3367ce Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 23 Jan 2025 09:08:22 -0800 Subject: [PATCH] [AST] Migrate away from PointerUnion::dyn_cast (NFC) Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with // isa, cast and the llvm::dyn_cast Literal migration would result in dyn_cast_if_present (see the definition of PointerUnion::dyn_cast), but this patch uses dyn_cast because we expect Source to be nonnull. --- clang/lib/AST/ByteCode/Descriptor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clang/lib/AST/ByteCode/Descriptor.cpp b/clang/lib/AST/ByteCode/Descriptor.cpp index 437b9f1bab2d6..1c16c2022dd02 100644 --- a/clang/lib/AST/ByteCode/Descriptor.cpp +++ b/clang/lib/AST/ByteCode/Descriptor.cpp @@ -428,17 +428,17 @@ QualType Descriptor::getElemQualType() const { } SourceLocation Descriptor::getLocation() const { - if (auto *D = Source.dyn_cast()) + if (auto *D = dyn_cast(Source)) return D->getLocation(); - if (auto *E = Source.dyn_cast()) + if (auto *E = dyn_cast(Source)) return E->getExprLoc(); llvm_unreachable("Invalid descriptor type"); } SourceInfo Descriptor::getLoc() const { - if (const auto *D = Source.dyn_cast()) + if (const auto *D = dyn_cast(Source)) return SourceInfo(D); - if (const auto *E = Source.dyn_cast()) + if (const auto *E = dyn_cast(Source)) return SourceInfo(E); llvm_unreachable("Invalid descriptor type"); }