Skip to content

Commit 8686e67

Browse files
[lld] Migrate away from PointerUnion::dyn_cast (NFC) (#125458)
Note that PointerUnion::dyn_cast has been soft deprecated in PointerUnion.h: // FIXME: Replace the uses of is(), get() and dyn_cast() with // isa<T>, cast<T> and the llvm::dyn_cast<T> 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.
1 parent 90dd964 commit 8686e67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lld/MachO/Relocations.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ InputSection *Reloc::getReferentInputSection() const {
3232
}
3333
3434
StringRef Reloc::getReferentString() const {
35-
if (auto *isec = referent.dyn_cast<InputSection *>()) {
35+
if (auto *isec = dyn_cast<InputSection *>(referent)) {
3636
const auto *cisec = dyn_cast<CStringInputSection>(isec);
3737
assert(cisec && "referent must be a CStringInputSection");
3838
return cisec->getStringRefAtOffset(addend);

0 commit comments

Comments
 (0)