ContentCache: Simplify by always owning the MemoryBuffer
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 14 Oct 2020 22:57:04 +0000 (18:57 -0400)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 21 Oct 2020 01:03:53 +0000 (21:03 -0400)
commit296314516d103f8eeb987a08b509c1381cfeef89
treed6c8d4f4e5a34f1a48b73a53c87d9ab65c6ea56d
parent134ffa8138c31444685013e10f592cd7c88d675b
ContentCache: Simplify by always owning the MemoryBuffer

This changes `ContentCache::Buffer` to use
`std::unique_ptr<MemoryBuffer>` instead of the `PointerIntPair`. It
drops the (mostly unused) `DoNotFree` bit, instead creating a (new)
non-owning `MemoryBuffer` instance when passed a `MemoryBufferRef`.

Differential Revision: https://reviews.llvm.org/D67030
clang/include/clang/Basic/SourceManager.h
clang/lib/Basic/SourceManager.cpp
clang/lib/Frontend/CompilerInstance.cpp