aboutsummaryrefslogtreecommitdiff
path: root/lib/Archive
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-04-19 15:42:05 +0000
committerDan Gohman <gohman@apple.com>2010-04-19 15:42:05 +0000
commitdfd4bbfdfba518f194f4795dfc963dfa456d0246 (patch)
treeac3d9e425ec917c296234a5a9a2a2a2550969291 /lib/Archive
parent5af8f421b6412e52530608097e39d2602195629f (diff)
Fix -Wcast-qual warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Archive')
-rw-r--r--lib/Archive/Archive.cpp2
-rw-r--r--lib/Archive/ArchiveReader.cpp9
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/Archive/Archive.cpp b/lib/Archive/Archive.cpp
index f4f8a4349e..4f100f7b11 100644
--- a/lib/Archive/Archive.cpp
+++ b/lib/Archive/Archive.cpp
@@ -241,7 +241,7 @@ llvm::GetBitcodeSymbols(const unsigned char *BufPtr, unsigned Length,
// Get the module.
std::auto_ptr<MemoryBuffer> Buffer(
MemoryBuffer::getNewMemBuffer(Length, ModuleID.c_str()));
- memcpy((char*)Buffer->getBufferStart(), BufPtr, Length);
+ memcpy(const_cast<char *>(Buffer->getBufferStart()), BufPtr, Length);
Module *M = ParseBitcodeFile(Buffer.get(), Context, ErrMsg);
if (!M)
diff --git a/lib/Archive/ArchiveReader.cpp b/lib/Archive/ArchiveReader.cpp
index 3ef15d25d6..cbd0bb3975 100644
--- a/lib/Archive/ArchiveReader.cpp
+++ b/lib/Archive/ArchiveReader.cpp
@@ -349,7 +349,8 @@ Archive::getAllModules(std::vector<Module*>& Modules,
"(" + I->getPath().str() + ")";
MemoryBuffer *Buffer =
MemoryBuffer::getNewMemBuffer(I->getSize(), FullMemberName.c_str());
- memcpy((char*)Buffer->getBufferStart(), I->getData(), I->getSize());
+ memcpy(const_cast<char *>(Buffer->getBufferStart()),
+ I->getData(), I->getSize());
Module *M = ParseBitcodeFile(Buffer, Context, ErrMessage);
delete Buffer;
@@ -489,7 +490,8 @@ Archive::findModuleDefiningSymbol(const std::string& symbol,
mbr->getPath().str() + ")";
MemoryBuffer *Buffer =MemoryBuffer::getNewMemBuffer(mbr->getSize(),
FullMemberName.c_str());
- memcpy((char*)Buffer->getBufferStart(), mbr->getData(), mbr->getSize());
+ memcpy(const_cast<char *>(Buffer->getBufferStart()),
+ mbr->getData(), mbr->getSize());
Module *m = getLazyBitcodeModule(Buffer, Context, ErrMsg);
if (!m)
@@ -617,7 +619,8 @@ bool Archive::isBitcodeArchive() {
MemoryBuffer *Buffer =
MemoryBuffer::getNewMemBuffer(I->getSize(), FullMemberName.c_str());
- memcpy((char*)Buffer->getBufferStart(), I->getData(), I->getSize());
+ memcpy(const_cast<char *>(Buffer->getBufferStart()),
+ I->getData(), I->getSize());
Module *M = ParseBitcodeFile(Buffer, Context);
delete Buffer;
if (!M)