[all-commits] [llvm/llvm-project] 296314: ContentCache: Simplify by always owning the Memory...

Duncan P. N. Exon Smith via All-commits all-commits at lists.llvm.org
Tue Oct 20 18:04:14 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 296314516d103f8eeb987a08b509c1381cfeef89
      https://github.com/llvm/llvm-project/commit/296314516d103f8eeb987a08b509c1381cfeef89
  Author: Duncan P. N. Exon Smith <dexonsmith at apple.com>
  Date:   2020-10-20 (Tue, 20 Oct 2020)

  Changed paths:
    M clang/include/clang/Basic/SourceManager.h
    M clang/lib/Basic/SourceManager.cpp
    M clang/lib/Frontend/CompilerInstance.cpp

  Log Message:
  -----------
  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




More information about the All-commits mailing list