[lld-macho] Simplify archive loading logic
This is a follow-on to {D129556}. I've refactored the code such that `addFile()` no longer needs to take an extra parameter. Additionally, the "do we force-load or not" policy logic is now fully contained within addFile, instead of being split between `addFile` and `parseLCLinkerOptions`. This also allows us to move the `ForceLoad` (now `LoadType`) enum out of the header file. Additionally, we can now correctly report loads induced by `LC_LINKER_OPTION` in our `-why_load` output. I've also added another test to check that CLI library non-force-loads take precedence over `LC_LINKER_OPTION` + `-force_load_swift_libs`. (The existing logic is correct, just untested.) Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D130137
Loading
Please sign in to comment