This patch plumbs the command line --experimental-debuginfo-iterators flag in to the pass managers, so that modules can be converted to the new format, passes run, then converted back to the old format. That allows developers to test-out the new debuginfo representation across some part of LLVM with no further work, and from the command line. We've also installed flag-catchers at the various points that bitcode and textual IR can egress from a process, and temporarily convert the module to dbg.value format when doing so. This allows, for example, the test suite to be run with the command line option, and the reasonable possibility that it could work! (More work required to get there though). These blocks of code should be considered transitory as we (hopefully) move from one debug-info format to another.
This patch also provides the BasicBlock::dumpDbgValues method to give a rough illustration of what the DPMarker / DPValue layout looks like in a block. This isn't intended to be a formal, textual representation of that information, only a debugging aid -- I'm still diligently keeping away from producing a textual IR.
There are no tests: it's not clear to me how to test this behaviour. The objective is to let you silently turn on a different, but transparent, representation in memory to see whether it works or not. Thus, there /shouldn't/ be an observable change in behaviour to test for. Possibly this means that unit tests are the answer, although I'm open to suggestions.
Have you tested building LLVM with -DBUILD_SHARED_LIBS=TRUE?