Skip to content

Commit aaf0643

Browse files
[lld] Migrate away from PointerUnion::dyn_cast (NFC) (#123891)
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 cast because we know expect isa<Symbol *>(rel.referent) to be true.
1 parent a5159e2 commit aaf0643

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lld/MachO/SyntheticSections.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ void InitOffsetsSection::writeTo(uint8_t *buf) const {
19581958
// FIXME: Add function specified by -init when that argument is implemented.
19591959
for (ConcatInputSection *isec : sections) {
19601960
for (const Reloc &rel : isec->relocs) {
1961-
const Symbol *referent = rel.referent.dyn_cast<Symbol *>();
1961+
const Symbol *referent = cast<Symbol *>(rel.referent);
19621962
assert(referent && "section relocation should have been rejected");
19631963
uint64_t offset = referent->getVA() - in.header->addr;
19641964
// FIXME: Can we handle this gracefully?

0 commit comments

Comments
 (0)