-
Notifications
You must be signed in to change notification settings - Fork 332
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
[APValue][BoundsSafety] Migrate away from PointerUnion::{is,get} (NFC) #9834
base: next
Are you sure you want to change the base?
Conversation
PointerUnion::{is,get} are 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> In this patch, I separated definitions of template functions from the header, in order to avoid nasty instantiation issues seemingly related to header dependency. rdar://142909627
@swift-ci test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@swift-ci test llvm |
Confirm that can reproduce the linker errors locally. There are other warnings about PointerUnion deprecation but they aren't in APValue so they are out of scope for this change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, might need to pull the template into the header since some binaries doesn't setup the dependency to run link APValue.cpp.o.
I can fix the link error. Adding explicit instantiation for |
@swift-ci test |
@swift-ci test llvm |
Looks like there are a bunch of unrelated build failures coming from other changes. |
@@ -44,6 +44,38 @@ APValue::LValueBase::LValueBase(const ValueDecl *P, unsigned I, unsigned V) | |||
APValue::LValueBase::LValueBase(const Expr *P, unsigned I, unsigned V) | |||
: Ptr(P), Local{I, V} {} | |||
|
|||
// Separated definitions of these template functions to avoid nasty build issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: guard this by // TO_UPSTREAM(BoundsSafety)
?
@swift-ci test |
PointerUnion::{is,get} are deprecated in PointerUnion.h:
// FIXME: Replace the uses of is(), get() and dyn_cast() with
// isa, cast and the llvm::dyn_cast
In this patch, I separated definitions of template functions from the header, in order to avoid nasty instantiation issues seemingly related to header dependency.
rdar://142909627