[all-commits] [llvm/llvm-project] 5a04c0: [lld] Migrate away from PointerUnion::dyn_cast (NF...
Kazu Hirata via All-commits
all-commits at lists.llvm.org
Fri Oct 2 09:24:35 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5a04c0a62947b12d1392abc71a5c72e88874e830
https://github.com/llvm/llvm-project/commit/5a04c0a62947b12d1392abc71a5c72e88874e830
Author: Kazu Hirata <kazu at google.com>
Date: 2026-10-02 (Fri, 02 Oct 2026)
Changed paths:
M lld/MachO/BPSectionOrderer.cpp
M lld/MachO/InputFiles.cpp
M lld/MachO/InputSection.cpp
M lld/MachO/MarkLive.cpp
M lld/MachO/Relocations.cpp
M lld/MachO/SyntheticSections.cpp
Log Message:
-----------
[lld] Migrate away from PointerUnion::dyn_cast (NFC) (#228356)
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
where the operands are known to be nonnull.
The operands are known to be nonnull in one of two ways:
- Preceding checks: In BPSectionOrderer.cpp,
reloc.getReferentInputSection() is called a few lines above (and the
caller checks r.referent.isNull()), guaranteeing the PointerUnion is
nonnull.
- Downstream code: The else or fallthrough branch unconditionally
calls cast<...> or dyn_cast<...> on the pointer, or dereferences it.
Assisted-by: Antigravity
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list