Skip to content
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

Add a runtime-internal function, _enumerateTypes(fromImageAt:conformingTo:_:), that will walk the protocol conformance tables looking for types that conform to a given protocol. #40515

Closed
wants to merge 1 commit into from

Conversation

grynspan
Copy link
Contributor

Add a runtime-internal function, _enumerateTypes(fromImageAt:conformingTo:_:), that will walk the protocol conformance tables looking for types that conform to a given protocol.

Resolves rdar://67501458.

@grynspan grynspan force-pushed the jgrynspan/type-discovery branch from 839a6bd to a64dcfc Compare December 10, 2021 23:48
@grynspan grynspan requested a review from briancroom December 10, 2021 23:49
@grynspan grynspan force-pushed the jgrynspan/type-discovery branch from a64dcfc to 14e6793 Compare December 10, 2021 23:55
@grynspan
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 14e679336c9ee44cc253a991d2d09637d890a5bf

@grynspan grynspan force-pushed the jgrynspan/type-discovery branch from 14e6793 to ef1ac64 Compare December 11, 2021 03:11
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan grynspan force-pushed the jgrynspan/type-discovery branch 2 times, most recently from 9fd12ee to 6690e14 Compare December 11, 2021 05:04
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan grynspan force-pushed the jgrynspan/type-discovery branch from 6690e14 to 0edccaa Compare December 11, 2021 05:45
@grynspan
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 0edccaaf10173ce80fb0c01051918cccd2afa246

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 0edccaaf10173ce80fb0c01051918cccd2afa246

@grynspan
Copy link
Contributor Author

Build failure appears unrelated to my changes, caused by swiftlang/swift-package-manager#3929. @tomerd

@grynspan grynspan force-pushed the jgrynspan/type-discovery branch from 0edccaa to ac06b0a Compare December 11, 2021 18:18
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan grynspan force-pushed the jgrynspan/type-discovery branch from ac06b0a to 65a039c Compare December 11, 2021 18:31
@grynspan
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 65a039c

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 65a039c

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 9b50342

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 9b50342

@grynspan grynspan force-pushed the jgrynspan/type-discovery branch from 9b50342 to a21eac6 Compare December 13, 2021 16:26
@jckarter
Copy link
Contributor

Can we reuse the existing logic in the runtime, used by the conformance cache, that crawls the metadata in an image looking for matching conformances?

@grynspan grynspan force-pushed the jgrynspan/type-discovery branch from a21eac6 to 7aa9f5b Compare December 13, 2021 19:00
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan
Copy link
Contributor Author

Can we reuse the existing logic in the runtime, used by the conformance cache, that crawls the metadata in an image looking for matching conformances?

That's effectively what this new function does (as much as is possible.)

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 7aa9f5b

@grynspan
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 7aa9f5b

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 7aa9f5b

@grynspan grynspan force-pushed the jgrynspan/type-discovery branch from 7aa9f5b to cb22ec5 Compare December 16, 2021 23:38
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan
Copy link
Contributor Author

I stripped out special handling for dlopen() handles under Mach because… woof. Instead, just pass #dsohandle or something #dsohandle-compatible. On Apple, that's a Mach header; on most Unixes it's __dso_handle, and on Windows it's __ImageBase. We'd probably want to document that somewhere.

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - cb22ec539b8b09c9dd90b0a442707dc9f7562cdd

…ngTo:_:), that will walk the protocol conformance tables looking for types that conform to a given protocol.
@grynspan grynspan force-pushed the jgrynspan/type-discovery branch from cb22ec5 to 87232e5 Compare December 17, 2021 00:49
@grynspan
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 87232e5

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - cb22ec539b8b09c9dd90b0a442707dc9f7562cdd

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 87232e5

@grynspan grynspan closed this Mar 2, 2022
@AnthonyLatsis AnthonyLatsis added runtime The Swift Runtime improvement and removed enhancement labels Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement runtime The Swift Runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants