summaryrefslogtreecommitdiff
path: root/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-08-29 07:59:55 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-08-29 07:59:55 +0000
commitf6983668b46c796d294bfacb00d7bbe25a6e4084 (patch)
tree07c2a029e110e200ef01845fad0aa54990f2ccf7 /lib/Basic/SourceManager.cpp
parent5630e0fe4f6dc34f6118eb593667dd755deb5a8e (diff)
downloadclang-f6983668b46c796d294bfacb00d7bbe25a6e4084.tar.gz
unique_ptrify SourceManager::createFileID
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216715 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
-rw-r--r--lib/Basic/SourceManager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp
index 47142e238e..0d47b09410 100644
--- a/lib/Basic/SourceManager.cpp
+++ b/lib/Basic/SourceManager.cpp
@@ -456,13 +456,13 @@ SourceManager::getOrCreateContentCache(const FileEntry *FileEnt,
/// createMemBufferContentCache - Create a new ContentCache for the specified
/// memory buffer. This does no caching.
-const ContentCache *
-SourceManager::createMemBufferContentCache(llvm::MemoryBuffer *Buffer) {
+const ContentCache *SourceManager::createMemBufferContentCache(
+ std::unique_ptr<llvm::MemoryBuffer> Buffer) {
// 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(Buffer);
+ Entry->setBuffer(std::move(Buffer));
return Entry;
}