dsymutil would like to use all the AsmPrinter/MCStreamer infrastructure
to stream out the DWARF. In order to do so, it will reuse the DIE object
and so this header needs to be public.
There are a couple of issues with that:
- Although the header only depends on public interfaces, it exposes a forward declaration of DwarfTypeUnit which is private.
- Some paths of the emission code use the DwarfDebug object stored in AsmPrinter. In dsymutil we will have an AsmPrinter, but the DwarfDebug object is to tied to the codegen to be reused.
Both of these issues only trigger if you actually use the functionality.
dsymutil should be able to get along without doing so, but this would
leave us with an API with some quite flaky parts.
Some ideas:
- document the flakiness and be done with it.
- try to remove the DwarfDebug adherence to DwarfDebug. Some of it is easy (for example the Dwarf version is also stored in the MCStreamer) but to remove it completely, we might need to us a base object to derive DwarfDebug from. This might be a bit overengineered especially if the functionality is unused.