diff --git a/llvm/lib/Support/MemoryBuffer.cpp b/llvm/lib/Support/MemoryBuffer.cpp index c590f02d74c1..3c1ee9062955 100644 --- a/llvm/lib/Support/MemoryBuffer.cpp +++ b/llvm/lib/Support/MemoryBuffer.cpp @@ -14,6 +14,7 @@ #include "llvm/Support/MemoryBuffer.h" #include "llvm/System/MappedFile.h" #include "llvm/System/Process.h" +#include #include #include #include @@ -158,7 +159,7 @@ MemoryBufferMMapFile::~MemoryBufferMMapFile() { MemoryBuffer *MemoryBuffer::getFile(const char *FilenameStart, unsigned FnSize, int64_t FileSize) { - sys::PathWithStatus P(FilenameStart, FnSize); + sys::PathWithStatus P(std::string(FilenameStart, FnSize)); #if 1 return new MemoryBufferMMapFile(P); #else