-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Runtime] Add a disabled workaround for protocol conformance checking to check conformances in reverse order. #35061
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
[Runtime] Add a disabled workaround for protocol conformance checking to check conformances in reverse order. #35061
Conversation
@swift-ci please test |
@swift-ci please test windows platform |
stdlib/public/runtime/Bincompat.cpp
Outdated
#include "swift/Runtime/Bincompat.h" | ||
|
||
bool swift::runtime::bincompat:: | ||
workaroundProtocolConformanceReverseIteration() { |
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.
Might be nice to do the following for wrapping (or just clang-format it):
namespace swift {
namespace runtime {
namespace bincompat {
bool workaroundProtocolConformanceReverseIteraction() {
return false;
}
}
}
}
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.
Clang-format gave me the version I had, but your version is still nicer. Updated.
ConformanceState() { | ||
scanSectionsBackwards = swift::runtime::bincompat:: |
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.
Might be able to get away with bincompat::workaroundProtocolConformanceReverseIteration()
.
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.
Almost. runtime::bincompat::...
works. Updated.
}; | ||
|
||
auto snapshot = C.SectionsToScan.snapshot(); | ||
if (C.scanSectionsBackwards) { |
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.
Might be nice to do something like:
if (C.scanSectionsBackwards)
std::reverse(std::begin(snapshot), std::end(snapshot))
for (auto §ion : snapshot)
processSection(section);
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.
As discussed offline, we can't mutate in place, but we settled on:
auto snapshot = C.SectionsToScan.snapshot();
if (C.scanSectionsBackwards) {
for (auto §ion : llvm::reverse(snapshot))
processSection(section);
} else {
for (auto §ion : snapshot)
processSection(section);
}
Build failed |
13ea40e
to
5303d4f
Compare
@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.
Thanks!
Build failed |
Build failed |
… to check conformances in reverse order. rdar://problem/72049977
5303d4f
to
9ac3b0e
Compare
@swift-ci please test |
rdar://problem/72049977