This is a follow-on to D129556: [lld-macho] Fix loading same libraries from both LC_LINKER_OPTION and command line. 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.)
Maybe say "only applies to swift files" in the comment here, or put "Swift" in the constant's name then?