-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[embedded] Implement non-allocating embedded Swift mode, under -no-allocations flag #70314
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
Conversation
@swift-ci please test |
d4ada46
to
27026c8
Compare
@swift-ci please test |
1 similar comment
@swift-ci please test |
if (getModule()->getOptions().EmbeddedSwift) { | ||
for (SILFunction &function : *module) { | ||
// Don't check constructors and destructors directly, they will be | ||
// checked if called from other functions, with better source loc info. |
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.
Not all constructors and destructors are directly called. For example, class destructors are implicitly called from destroy_value
instructions.
Excluding them here means that they are potentially not checked at all.
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.
Hm, good point. What if instead of not checking them, I only changed the order in which we go over the SILFunctions, so that it's something like (1) public/external functions first, (2) vtable members without constructors/destructors, (3) constructors/destructors?
The motivation is strictly to get better diagnostics with better "called from here" information, I don't want to skip any checks.
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.
I only changed the order in which we go over the SILFunctions
Sounds good!
1a20fe1
to
2739aeb
Compare
…gnostics when diagnosing embedded Swift restrictions
@swift-ci please 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.
lgtm!
@swift-ci please test |
This PR: