mirror of
https://github.com/intel/llvm.git
synced 2026-01-18 07:57:36 +08:00
[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.
This commit is contained in:
@@ -1958,7 +1958,7 @@ void InitOffsetsSection::writeTo(uint8_t *buf) const {
|
||||
// FIXME: Add function specified by -init when that argument is implemented.
|
||||
for (ConcatInputSection *isec : sections) {
|
||||
for (const Reloc &rel : isec->relocs) {
|
||||
const Symbol *referent = rel.referent.dyn_cast<Symbol *>();
|
||||
const Symbol *referent = cast<Symbol *>(rel.referent);
|
||||
assert(referent && "section relocation should have been rejected");
|
||||
uint64_t offset = referent->getVA() - in.header->addr;
|
||||
// FIXME: Can we handle this gracefully?
|
||||
|
||||
Reference in New Issue
Block a user