Cleanup compiler warnings on discarding type qualifiers in casts. Switch to C++ style casts.

Patch by Saleem Abdulrasool!

Differential Revision: http://llvm-reviews.chandlerc.com/D204

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170917 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2012-12-21 19:09:53 +00:00
parent 70fe6ecb6d
commit 4e23ebe766
2 changed files with 10 additions and 6 deletions

View File

@ -371,12 +371,16 @@ FunctionPass *llvm::createARMJITCodeEmitterPass(ARMBaseTargetMachine &TM,
}
bool ARMCodeEmitter::runOnMachineFunction(MachineFunction &MF) {
assert((MF.getTarget().getRelocationModel() != Reloc::Default ||
MF.getTarget().getRelocationModel() != Reloc::Static) &&
TargetMachine &Target = const_cast<TargetMachine&>(MF.getTarget());
assert((Target.getRelocationModel() != Reloc::Default ||
Target.getRelocationModel() != Reloc::Static) &&
"JIT relocation model must be set to static or default!");
JTI = ((ARMBaseTargetMachine &)MF.getTarget()).getJITInfo();
II = (const ARMBaseInstrInfo *)MF.getTarget().getInstrInfo();
TD = MF.getTarget().getDataLayout();
JTI = static_cast<ARMJITInfo*>(Target.getJITInfo());
II = static_cast<const ARMBaseInstrInfo*>(Target.getInstrInfo());
TD = Target.getDataLayout();
Subtarget = &TM.getSubtarget<ARMSubtarget>();
MCPEs = &MF.getConstantPool()->getConstants();
MJTEs = 0;

View File

@ -209,7 +209,7 @@ ARMConstantPoolSymbol::ARMConstantPoolSymbol(LLVMContext &C, const char *s,
S(strdup(s)) {}
ARMConstantPoolSymbol::~ARMConstantPoolSymbol() {
free((void*)S);
free(const_cast<void*>(reinterpret_cast<const void *>(S)));
}
ARMConstantPoolSymbol *