Interleaved source printing during disassembly is a useful feature, but all the classes for it live in llvm-objdump.cpp and can't be used by the (weirdly) separate MachODumper.cpp. This patch pretty mechanically moves the needed bits (and command-line options) into a shareable header and adds the needed hooks for MachO.
Details
Diff Detail
Unit Tests
Event Timeline
Looks like this is causing test failures? Maybe you could break it down into a couple of patches, with the first being the simple moving of code, and later patches adding the new functionality for MachO?
Moving the code is a good time to address any formatting issues highlighted by clang-tidy/clang-format too.
Thanks, this should now be just the NFC refactoring, with most clang-tidy/clang-format suggestions applied (I ignored the DWARF one for obvious reasons).
I'm not sure what's going on with those test failures, it works on my local Linux machine. But now that this is non-MachO that's a problem for another time.
clang-format: please reformat the code