summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/APFloat.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2010-12-07 08:25:19 +0000
committerJay Foad <jay.foad@gmail.com>2010-12-07 08:25:19 +0000
commit583abbc4df3d9b9e5a86a56ae581970b98dc5249 (patch)
tree62e559937dd04e2a764f7423e50f94a5641022f9 /llvm/lib/Support/APFloat.cpp
parent10e1b56e2c9b920d5f3509abb8a6df3815200839 (diff)
downloadbcm5719-llvm-583abbc4df3d9b9e5a86a56ae581970b98dc5249.tar.gz
bcm5719-llvm-583abbc4df3d9b9e5a86a56ae581970b98dc5249.zip
PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() and
zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. llvm-svn: 121120
Diffstat (limited to 'llvm/lib/Support/APFloat.cpp')
-rw-r--r--llvm/lib/Support/APFloat.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp
index c0151e26fb1..a83801ed068 100644
--- a/llvm/lib/Support/APFloat.cpp
+++ b/llvm/lib/Support/APFloat.cpp
@@ -3310,7 +3310,7 @@ namespace {
// Truncate the significand down to its active bit count, but
// don't try to drop below 32.
unsigned newPrecision = std::max(32U, significand.getActiveBits());
- significand.trunc(newPrecision);
+ significand = significand.trunc(newPrecision);
}
@@ -3415,7 +3415,7 @@ void APFloat::toString(SmallVectorImpl<char> &Str,
// Nothing to do.
} else if (exp > 0) {
// Just shift left.
- significand.zext(semantics->precision + exp);
+ significand = significand.zext(semantics->precision + exp);
significand <<= exp;
exp = 0;
} else { /* exp < 0 */
@@ -3434,7 +3434,7 @@ void APFloat::toString(SmallVectorImpl<char> &Str,
// Multiply significand by 5^e.
// N * 5^0101 == N * 5^(1*1) * 5^(0*2) * 5^(1*4) * 5^(0*8)
- significand.zext(precision);
+ significand = significand.zext(precision);
APInt five_to_the_i(precision, 5);
while (true) {
if (texp & 1) significand *= five_to_the_i;
OpenPOWER on IntegriCloud