pretty -native -injected-sources -injected-source-content works with this patch, and produces identical output to the dia version
- I'd like to get feedback on the high-level design here, since I'm not familiar with how things are supposed to be done in this code. In particular, does the split between NativeEnumInjectedSources and InjectedSourceStream make sense? Are these names consistent with the rest of the code?
- The injected source _writing_ is done in PDBFileBuilder. Now that InjectedSourceStream exists, should there be a InjectedSourceStreamBuilder that does the building part? (If so, probably in a follow-up)
(I wish I had had this when working on PR41626, and when I was looking at natvis stuff again the other day I realized I had almost forgotten all this stuff again. So I figured I'd try to implement this while I still remember it.)
FWIW, it is not correct to handle LLVM errors like that.
This code fails if the code is compiled with LLVM_ENABLE_ABI_BREAKING_CHECKS in Release (i.e. when asserts are disabled).
The problem is that getStringForID returns Expected<StringRef> and Expected value must always
be checked, even if it is in success state.
Test failture log (found with check-llvm call):