aboutsummaryrefslogtreecommitdiff
path: root/lib/Index/SimpleFormatContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Index/SimpleFormatContext.h')
-rw-r--r--lib/Index/SimpleFormatContext.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Index/SimpleFormatContext.h b/lib/Index/SimpleFormatContext.h
index a460863f803e..080a4ad04ddf 100644
--- a/lib/Index/SimpleFormatContext.h
+++ b/lib/Index/SimpleFormatContext.h
@@ -13,8 +13,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_SIMPLE_FORM_CONTEXT_H
-#define LLVM_CLANG_SIMPLE_FORM_CONTEXT_H
+#ifndef LLVM_CLANG_LIB_INDEX_SIMPLEFORMATCONTEXT_H
+#define LLVM_CLANG_LIB_INDEX_SIMPLEFORMATCONTEXT_H
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/DiagnosticOptions.h"
@@ -47,10 +47,11 @@ public:
~SimpleFormatContext() { }
FileID createInMemoryFile(StringRef Name, StringRef Content) {
- llvm::MemoryBuffer *Source = llvm::MemoryBuffer::getMemBuffer(Content);
+ std::unique_ptr<llvm::MemoryBuffer> Source =
+ llvm::MemoryBuffer::getMemBuffer(Content);
const FileEntry *Entry =
Files.getVirtualFile(Name, Source->getBufferSize(), 0);
- Sources.overrideFileContents(Entry, Source);
+ Sources.overrideFileContents(Entry, std::move(Source));
assert(Entry != nullptr);
return Sources.createFileID(Entry, SourceLocation(), SrcMgr::C_User);
}