forked from OSchip/llvm-project
Fix Casting Bug
Add a const version of getFpValPtr to avoid a cast-away-const warning. llvm-svn: 172467
This commit is contained in:
parent
fcdab1d995
commit
530430be98
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue