Based on the discussion in https://reviews.llvm.org/D130221
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Event Timeline
this isn't exactly what was discussed in https://reviews.llvm.org/D130221 but it seems like making LinkGraphMaterializationUnit accessible is nicer for unit tests where we only care to test its behavior vs the whole system. lmk what you think. Locally I also have a patch to use MachOPlatform::isInitializerSection instead of the local version here but I wanted to prove the tests pass before and after so I didn't include it yet.
Yeah, this is the sort of testing /I/ think would be nice to have, but hope @lhames can take a look/give his perspective.
I haven't had a chance for a proper read yet -- will do that when I get back from vacation next week.
My first thought is that, following the reasoning in https://reviews.llvm.org/D130221, we should aim to merge MachOPlatform::isInitializerSection and hasMachOInitSection into a new function in ObjectFileInterface.h and use that.
If we do that we may find that this is testable in LinkGraphTests.cpp rather than ObjectLinkingLayer.
dropping this one and went for the discussed approach in https://reviews.llvm.org/D139347 which has no overlap with this one