When the Preprocessor (PP) in compiler instance is going away, we should clear the cache of any pointers that it owns as they will be destroyed.
This is one possible fix for the issue I outlined in http://lists.llvm.org/pipermail/cfe-dev/2019-February/061293.html that received no responses. We have now encountered the issue in multiple internal buildbots and I have even seen it in external bots as well. This really should be fixed.
As outlined in my cfe-dev post, it is exceedingly difficult to produce a reliable test case for this (at least for me) so I have not provided one.
If others should be on the list of reviewers, please add them.