In D106876, we stopped serializing module map files that didn't affect compilation of the current module.
However, since each SourceLocation is simply an offset into SourceManager's global buffer of concatenated input files in, these need to be adjusted during serialization. Otherwise, they can incorrectly point after the buffer or into subsequent input file.
This patch starts adjusting SourceLocations, FileIDs and other SourceManager offsets in ASTWriter.
The logic for isLoadedOffset() suggests that it could maybe be subsumed with "location past the end"?