Dont cast away const needlessly. Found by gcc48 -Wcast-qual.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163324 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Roman Divacky 2012-09-06 15:42:13 +00:00
parent 24b9f258f1
commit 5177b3a8c4
3 changed files with 4 additions and 3 deletions

View File

@ -659,7 +659,8 @@ static Constant *SymbolicallyEvaluateGEP(ArrayRef<Constant *> Ops,
unsigned BitWidth = TD->getTypeSizeInBits(IntPtrTy);
APInt Offset =
APInt(BitWidth, TD->getIndexedOffset(Ptr->getType(),
makeArrayRef((Value **)Ops.data() + 1,
makeArrayRef((Value *const*)
Ops.data() + 1,
Ops.size() - 1)));
Ptr = StripPtrCastKeepAS(Ptr);

View File

@ -2864,7 +2864,7 @@ bool BitcodeReader::InitStream() {
}
bool BitcodeReader::InitStreamFromBuffer() {
const unsigned char *BufPtr = (unsigned char *)Buffer->getBufferStart();
const unsigned char *BufPtr = (const unsigned char*)Buffer->getBufferStart();
const unsigned char *BufEnd = BufPtr+Buffer->getBufferSize();
if (Buffer->getBufferSize() & 3) {

View File

@ -522,7 +522,7 @@ void StackColoring::expungeSlotMap(DenseMap<int, int> &SlotRemap,
bool StackColoring::runOnMachineFunction(MachineFunction &Func) {
DEBUG(dbgs() << "********** Stack Coloring **********\n"
<< "********** Function: "
<< ((Value*)Func.getFunction())->getName() << '\n');
<< ((const Value*)Func.getFunction())->getName() << '\n');
MF = &Func;
MFI = MF->getFrameInfo();
Indexes = &getAnalysis<SlotIndexes>();