[llvm-commits] Trivial warning

Joe Abbey jabbey at arxan.com
Thu Nov 15 21:38:14 PST 2012


Hal (et al),

One of my build bots reported a warning:

PPCRegisterInfo.cpp:501:51: warning: cast from type ‘const llvm::MachineFunction*’ to type ‘llvm::MachineFunction*’ casts away qualifiers [-Wcast-qual]

Index: lib/Target/PowerPC/PPCRegisterInfo.cpp
===================================================================
--- lib/Target/PowerPC/PPCRegisterInfo.cpp (revision 168110)
+++ lib/Target/PowerPC/PPCRegisterInfo.cpp (working copy)
@@ -498,7 +498,8 @@
     } 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;
     }

Ok to commit?

Joe
______________________________
Joe Abbey
Director of Software Development
Arxan Technologies
jabbey at arxan.com<mailto:jabbey at arxan.com> www.arxan.com<http://www.arxan.com/>
Protecting the App Economy™



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121115/fb4c7284/attachment.html>


More information about the llvm-commits mailing list