[llvm-commits] [llvm] r172467 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp
David Greene
greened at obbligato.org
Mon Jan 14 13:04:40 PST 2013
Author: greened
Date: Mon Jan 14 15:04:40 2013
New Revision: 172467
URL: http://llvm.org/viewvc/llvm-project?rev=172467&view=rev
Log:
Fix Casting Bug
Add a const version of getFpValPtr to avoid a cast-away-const warning.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp?rev=172467&r1=172466&r2=172467&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAddSub.cpp Mon Jan 14 15:04:40 2013
@@ -66,10 +66,12 @@
bool insaneIntVal(int V) { return V > 4 || V < -4; }
APFloat *getFpValPtr(void)
{ return reinterpret_cast<APFloat*>(&FpValBuf.buffer[0]); }
+ const APFloat *getFpValPtr(void) const
+ { return reinterpret_cast<const APFloat*>(&FpValBuf.buffer[0]); }
const APFloat &getFpVal(void) const {
assert(IsFp && BufHasFpVal && "Incorret state");
- return *reinterpret_cast<const APFloat*>(&FpValBuf.buffer[0]);
+ return *getFpValPtr();
}
APFloat &getFpVal(void)
More information about the llvm-commits
mailing list