[flang] Use braces for auto initialization in lib/common and lib/evaluate
authorpeter klausler <pklausler@nvidia.com>
Wed, 11 Jul 2018 00:11:12 +0000 (17:11 -0700)
committerpeter klausler <pklausler@nvidia.com>
Wed, 11 Jul 2018 17:21:34 +0000 (10:21 -0700)
Original-commit: flang-compiler/f18@b0d1dd434bbcd55613d2f0b67863905baa8f818b
Reviewed-on: https://github.com/flang-compiler/f18/pull/119
Tree-same-pre-rewrite: false

flang/lib/common/indirection.h
flang/lib/evaluate/real.cc
flang/lib/evaluate/real.h
flang/lib/evaluate/rounding-bits.h

index b496ff6..2fbcc51 100644 (file)
@@ -47,7 +47,7 @@ public:
   }
   Indirection &operator=(Indirection &&that) {
     CHECK(that.p_ && "move assignment of null Indirection to Indirection");
-    auto tmp = p_;
+    auto tmp{p_};
     p_ = that.p_;
     that.p_ = tmp;
     return *this;
@@ -95,7 +95,7 @@ public:
   }
   Indirection &operator=(Indirection &&that) {
     CHECK(that.p_ && "move assignment of null Indirection to Indirection");
-    auto tmp = p_;
+    auto tmp{p_};
     p_ = that.p_;
     that.p_ = tmp;
     return *this;
index d2cf49c..2daae14 100644 (file)
@@ -123,7 +123,7 @@ ValueWithRealFlags<Real<W, P, IM>> Real<W, P, IM>::Add(
     yFraction = yFraction.NOT();
     carry = roundingBits.Negate();
   }
-  auto sum = fraction.AddUnsigned(yFraction, carry);
+  auto sum{fraction.AddUnsigned(yFraction, carry)};
   fraction = sum.value;
   if (isNegative == yIsNegative && sum.carry) {
     roundingBits.ShiftRight(sum.value.BTEST(0));
@@ -154,7 +154,7 @@ ValueWithRealFlags<Real<W, P, IM>> Real<W, P, IM>::Multiply(
         result.value.word_ = InfinityWord(isNegative);
       }
     } else {
-      auto product = GetFraction().MultiplyUnsigned(y.GetFraction());
+      auto product{GetFraction().MultiplyUnsigned(y.GetFraction())};
       std::int64_t exponent{CombineExponents(y, false)};
       if (exponent < 1) {
         int rshift = 1 - exponent;
index 955b8bf..0726f6d 100644 (file)
@@ -173,7 +173,7 @@ public:
         if (!fraction.IBITS(0, rshift).IsZero()) {
           result.flags.set(RealFlag::Inexact);
         }
-        auto truncated = result.value.ConvertUnsigned(fraction.SHIFTR(rshift));
+        auto truncated{result.value.ConvertUnsigned(fraction.SHIFTR(rshift))};
         if (truncated.overflow) {
           result.flags.set(RealFlag::Overflow);
         } else {
@@ -191,7 +191,7 @@ public:
       if (result.flags.test(RealFlag::Overflow)) {
         result.value = result.value.HUGE();
       } else if (isNegative) {
-        auto negated = result.value.Negate();
+        auto negated{result.value.Negate()};
         if (negated.overflow) {
           result.flags.set(RealFlag::Overflow);
           result.value = result.value.HUGE();
index fbdcb17..1e27330 100644 (file)
@@ -39,7 +39,7 @@ public:
       if (rshift >= fraction.bits + 2) {
         sticky_ = !fraction.IsZero();
       } else {
-        auto mask = fraction.MASKR(rshift - 2);
+        auto mask{fraction.MASKR(rshift - 2)};
         sticky_ = !fraction.IAND(mask).IsZero();
       }
     }