From 4ffe7d356d7a470d20741888ab7ad7d61537e7a6 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 2 Feb 2025 12:02:45 -0800 Subject: [PATCH] [lld] 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 referent to be nonnull. --- lld/MachO/Relocations.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lld/MachO/Relocations.cpp b/lld/MachO/Relocations.cpp index aac0e1bd3c9e0..78cc13388d6eb 100644 --- a/lld/MachO/Relocations.cpp +++ b/lld/MachO/Relocations.cpp @@ -32,7 +32,7 @@ InputSection *Reloc::getReferentInputSection() const { } StringRef Reloc::getReferentString() const { - if (auto *isec = referent.dyn_cast()) { + if (auto *isec = dyn_cast(referent)) { const auto *cisec = dyn_cast(isec); assert(cisec && "referent must be a CStringInputSection"); return cisec->getStringRefAtOffset(addend);