diff options
Diffstat (limited to 'include/clang/Lex/HeaderMap.h')
-rw-r--r-- | include/clang/Lex/HeaderMap.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/clang/Lex/HeaderMap.h b/include/clang/Lex/HeaderMap.h index 8e78b5a..993c861 100644 --- a/include/clang/Lex/HeaderMap.h +++ b/include/clang/Lex/HeaderMap.h @@ -16,6 +16,7 @@ #include "clang/Basic/LLVM.h" #include "llvm/Support/Compiler.h" +#include <memory> namespace llvm { class MemoryBuffer; @@ -34,15 +35,12 @@ class HeaderMap { HeaderMap(const HeaderMap &) LLVM_DELETED_FUNCTION; void operator=(const HeaderMap &) LLVM_DELETED_FUNCTION; - const llvm::MemoryBuffer *FileBuffer; + std::unique_ptr<const llvm::MemoryBuffer> FileBuffer; bool NeedsBSwap; - HeaderMap(const llvm::MemoryBuffer *File, bool BSwap) - : FileBuffer(File), NeedsBSwap(BSwap) { - } + HeaderMap(std::unique_ptr<const llvm::MemoryBuffer> File, bool BSwap) + : FileBuffer(std::move(File)), NeedsBSwap(BSwap) {} public: - ~HeaderMap(); - /// HeaderMap::Create - This attempts to load the specified file as a header /// map. If it doesn't look like a HeaderMap, it gives up and returns null. static const HeaderMap *Create(const FileEntry *FE, FileManager &FM); |