summaryrefslogtreecommitdiff
path: root/lib/Archive/Archive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Archive/Archive.cpp')
-rw-r--r--lib/Archive/Archive.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Archive/Archive.cpp b/lib/Archive/Archive.cpp
index 4f100f7b11e..54c715c604d 100644
--- a/lib/Archive/Archive.cpp
+++ b/lib/Archive/Archive.cpp
@@ -233,15 +233,14 @@ bool llvm::GetBitcodeSymbols(const sys::Path& fName,
}
Module*
-llvm::GetBitcodeSymbols(const unsigned char *BufPtr, unsigned Length,
+llvm::GetBitcodeSymbols(const char *BufPtr, unsigned Length,
const std::string& ModuleID,
LLVMContext& Context,
std::vector<std::string>& symbols,
std::string* ErrMsg) {
// Get the module.
std::auto_ptr<MemoryBuffer> Buffer(
- MemoryBuffer::getNewMemBuffer(Length, ModuleID.c_str()));
- memcpy(const_cast<char *>(Buffer->getBufferStart()), BufPtr, Length);
+ MemoryBuffer::getMemBufferCopy(StringRef(BufPtr, Length),ModuleID.c_str()));
Module *M = ParseBitcodeFile(Buffer.get(), Context, ErrMsg);
if (!M)