This is a prep patch for https://reviews.llvm.org/D66782, changing SourceManager to return Optional<MemoryBufferRef> instead of MemoryBuffer. With that change the address of the MemoryBuffer will be gone, so instead use the start of the buffer as the key for this map.
No functionality change intended.
Radar-Id: rdar://70139990
Looking over the code this method doesn't seem necessary anymore. Can you get the buffer pointer in createFile down below, after llvm::MemoryBuffer::getMemBuffer(*Contents, Entry->getName(), /*RequiresNullTerminator=*/false) is constructed?