Using const cast to alleviate a warning.
authorJoe Abbey <jabbey@arxan.com>
Fri, 16 Nov 2012 19:38:42 +0000 (19:38 +0000)
committerJoe Abbey <jabbey@arxan.com>
Fri, 16 Nov 2012 19:38:42 +0000 (19:38 +0000)
A PR is being filed to address some code issues here.

llvm-svn: 168185

llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp

index 459c358..1f00b3b 100644 (file)
@@ -498,7 +498,8 @@ PPCRegisterInfo::hasReservedSpillSlot(const MachineFunction &MF,
     } else if (CRSpillFrameIdx) {
       FrameIdx = CRSpillFrameIdx;
     } else {
-      MachineFrameInfo *MFI = ((MachineFunction &)MF).getFrameInfo();
+      MachineFrameInfo *MFI = 
+        (const_cast<MachineFunction &>(MF)).getFrameInfo();
       FrameIdx = MFI->CreateFixedObject((uint64_t)4, (int64_t)-4, true);
       CRSpillFrameIdx = FrameIdx;
     }