[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.
This commit is contained in:
parent
90dd964328
commit
8686e677ff
@ -32,7 +32,7 @@ InputSection *Reloc::getReferentInputSection() const {
|
||||
}
|
||||
|
||||
StringRef Reloc::getReferentString() const {
|
||||
if (auto *isec = referent.dyn_cast<InputSection *>()) {
|
||||
if (auto *isec = dyn_cast<InputSection *>(referent)) {
|
||||
const auto *cisec = dyn_cast<CStringInputSection>(isec);
|
||||
assert(cisec && "referent must be a CStringInputSection");
|
||||
return cisec->getStringRefAtOffset(addend);
|
||||
|
Loading…
x
Reference in New Issue
Block a user