diff options
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index f0b53b4e48a..620f05c6377 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -409,15 +409,16 @@ SourceManager::getOrCreateContentCache(const FileEntry *FileEnt, } -/// createMemBufferContentCache - Create a new ContentCache for the specified -/// memory buffer. This does no caching. -const ContentCache *SourceManager::createMemBufferContentCache( - std::unique_ptr<llvm::MemoryBuffer> Buffer) { +/// Create a new ContentCache for the specified memory buffer. +/// This does no caching. +const ContentCache * +SourceManager::createMemBufferContentCache(llvm::MemoryBuffer *Buffer, + bool DoNotFree) { // Add a new ContentCache to the MemBufferInfos list and return it. ContentCache *Entry = ContentCacheAlloc.Allocate<ContentCache>(); new (Entry) ContentCache(); MemBufferInfos.push_back(Entry); - Entry->setBuffer(std::move(Buffer)); + Entry->replaceBuffer(Buffer, DoNotFree); return Entry; } |