This was originally uploaded as D32615, but some problems were discovered in the way that filenames were mapped to indices, which necessitated some preliminary refactoring. That has been done, so this is the new patch uploaded, based on top of the refactorings. Hopefully this diff is much smaller than before.
For example usage of the API, see the yamlToPdb function in llvm-pdbdump.cpp
This is essentially an assert, right? Do you want this check to be performed even in noassert builds? If not, please rewrite using assert. If you do want this evaluated in noassert builds, can you replace __debugbreak with llvm_unreachable?