mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-06 09:44:39 +00:00
Fix -Wcast-qual warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101779 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5af8f421b6
commit
dfd4bbfdfb
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -126,13 +126,15 @@ void TypeSymbolTable::refineAbstractType(const DerivedType *OldType,
|
||||
// faster to remove them all in one pass.
|
||||
//
|
||||
for (iterator I = begin(), E = end(); I != E; ++I) {
|
||||
if (I->second == (Type*)OldType) { // FIXME when Types aren't const.
|
||||
// FIXME when Types aren't const.
|
||||
if (I->second == const_cast<DerivedType *>(OldType)) {
|
||||
#if DEBUG_ABSTYPE
|
||||
dbgs() << "Removing type " << OldType->getDescription() << "\n";
|
||||
#endif
|
||||
OldType->removeAbstractTypeUser(this);
|
||||
|
||||
I->second = (Type*)NewType; // TODO FIXME when types aren't const
|
||||
// TODO FIXME when types aren't const
|
||||
I->second = const_cast<Type *>(NewType);
|
||||
if (NewType->isAbstract()) {
|
||||
#if DEBUG_ABSTYPE
|
||||
dbgs() << "Added type " << NewType->getDescription() << "\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user