aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2013-01-14 21:04:40 +0000
committerDavid Greene <greened@obbligato.org>2013-01-14 21:04:40 +0000
commit4ee576fac3a84553c9342faea87ff0e13e8eb48d (patch)
tree5cd9827ee6ea7c6ebaa835f7f7fd534206bb109d /lib
parent5a80eefdf7ef9022cd148b9eed16aa3c14b59a56 (diff)
Fix Casting Bug
Add a const version of getFpValPtr to avoid a cast-away-const warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/InstCombine/InstCombineAddSub.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineAddSub.cpp b/lib/Transforms/InstCombine/InstCombineAddSub.cpp
index f07c58d7d0..03be8ef6fb 100644
--- a/lib/Transforms/InstCombine/InstCombineAddSub.cpp
+++ b/lib/Transforms/InstCombine/InstCombineAddSub.cpp
@@ -66,10 +66,12 @@ namespace {
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)