-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lld] Migrate away from PointerUnion::dyn_cast (NFC) #123721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lld] Migrate away from PointerUnion::dyn_cast (NFC) #123721
Conversation
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<InputSection *>(reloc.referent) to be true.
@llvm/pr-subscribers-lld @llvm/pr-subscribers-lld-macho Author: Kazu Hirata (kazutakahirata) ChangesNote that PointerUnion::dyn_cast has been soft deprecated in // FIXME: Replace the uses of is(), get() and dyn_cast() with Literal migration would result in dyn_cast_if_present (see the Full diff: https://github.com/llvm/llvm-project/pull/123721.diff 1 Files Affected:
diff --git a/lld/MachO/Arch/ARM64.cpp b/lld/MachO/Arch/ARM64.cpp
index bf458e392be8fb..2f3ca13b832a11 100644
--- a/lld/MachO/Arch/ARM64.cpp
+++ b/lld/MachO/Arch/ARM64.cpp
@@ -205,7 +205,7 @@ InputSection *ARM64::getThunkBranchTarget(InputSection *thunk) const {
assert(isa<InputSection *>(reloc.referent) &&
"ARM64 thunk reloc is expected to point to an InputSection");
- return reloc.referent.dyn_cast<InputSection *>();
+ return cast<InputSection *>(reloc.referent);
}
uint32_t ARM64::getICFSafeThunkSize() const { return sizeof(icfSafeThunkCode); }
|
@nikic Friendly ping. Thanks! |
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/30/builds/14249 Here is the relevant piece of the build log for the reference
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/195/builds/3794 Here is the relevant piece of the build log for the reference
|
Note that PointerUnion::dyn_cast has been soft deprecated in
PointerUnion.h:
// FIXME: Replace the uses of is(), get() and dyn_cast() with
// isa, cast and the llvm::dyn_cast
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<InputSection *>(reloc.referent) to be true.