In addition to removing OrcV1, the orcv1-removal branch also contains a prototype of the removable code feature. I’m going to discuss this at greater length over the next couple of weeks, but if anyone’s interested in playing with the prototype I’d recommend starting with the ResourceTracker class in https://github.com/lhames/llvm-project/commit/de6f6d57d3e955b998f82ab6e610da41fcb09492.
Finally, adding removable code unblocked another prototype I’ve been working on: an OrcRPC based TargetProcessControl implementation. I’ve added that to the “orcv1-removal-with-remote-tpc” branch at https://github.com/lhames/llvm-project. The easiest way to start playing with this feature is via the new llvm-jitlink options: -oop-executor, and -oop-executor-connect. The -oop-executor option will fork and exec the llvm-jitlink-executor program and connect to it via open file descriptors (similar to how lli-child-target works). The -oop-executor-connect option will connect to a listening llvm-jitlink-executor process via TCP, but otherwise behaves the same. E.g.
Oh, I almost forgot: The “orcv1-removal-with-remote-tpc” also contains a next step towards breaking Orc up into distinct libraries.
Chris Bieneman started this process on the mainline a while back by moving some of the Orc error types into a separate OrcError library (Thanks Chris!). The orcv1-removal-with-remote-tpc branch takes this further.
(1) It adds a new OrcTargetProcess library that contains code specific to JIT execution. E.g. runAsMain, in-process eh-frame registration code, and the OrcRPCTPCServer type.
(2) It renames OrcError to OrcShared. This will be a home for types that are shared between Orc and OrcTargetProcess. It’s likely to me mostly headers, but may contain some code snippets.
This break-up isn’t fully implemented in the branch yet: Orc still depends directly on OrcTargetProcess in places. This is just incomplete work, not by design.
Eventually I hope to decouple Orc (and JITLink) from ExecutionEngine entirely. With the removal of OrcV1 this should be much easier: The main changes will be a substitute types for JITTargetAddress and JITEvaluatedSymbol (we can come up with better names for them while we’re at it), and moving RTDyldObjectLinkingLayer from ORC to RuntimeDyld.
Thoughts on the break-up (and any of the topics from the weekly mail) are very welcome.
Finally, correcting the typo above – the final example should have been:
"The majority of the ORCv1 layers and utilities were renamed with a ‘Legacy’ prefix in LLVM 8.0, and have deprecation warnings attached in LLVM 9.0. In LLVM 10.0 ORCv1 will be removed entirely.
It turns out several clients were relying on the OrcV1 removable code feature and I didn’t want to force them onto OrcV2 without a solution for that. So far I’m happy with how the OrcV2 removable code prototype is shaping up – assuming we don’t discover any major issues with the idea I do hope to remove OrcV1 before LLVM 12 is released.