Reorganize FastMathFlags to be a wrapper around unsigned, and streamline some interfaces.
[oota-llvm.git] / lib / Bitcode / Reader / BitcodeReader.cpp
index 131151f5354c6025d2f35708370e6e0d82b263e2..1fdea799d0298c0551b163f3023e2e8ce248e9e6 100644 (file)
@@ -2047,16 +2047,16 @@ bool BitcodeReader::ParseFunctionBody(Function *F) {
             cast<BinaryOperator>(I)->setIsExact(true);
         } else if (isa<FPMathOperator>(I)) {
           FastMathFlags FMF;
-          FMF.UnsafeAlgebra =
-            0 != (Record[OpNum] & FPMathOperator::UnsafeAlgebra);
-          FMF.NoNaNs =
-            0 != (Record[OpNum] & FPMathOperator::NoNaNs);
-          FMF.NoInfs =
-            0 != (Record[OpNum] & FPMathOperator::NoInfs);
-          FMF.NoSignedZeros =
-            0 != (Record[OpNum] & FPMathOperator::NoSignedZeros);
-          FMF.AllowReciprocal =
-            0 != (Record[OpNum] & FPMathOperator::AllowReciprocal);
+          if (0 != (Record[OpNum] & FastMathFlags::UnsafeAlgebra))
+            FMF.setUnsafeAlgebra();
+          if (0 != (Record[OpNum] & FastMathFlags::NoNaNs))
+            FMF.setNoNaNs();
+          if (0 != (Record[OpNum] & FastMathFlags::NoInfs))
+            FMF.setNoInfs();
+          if (0 != (Record[OpNum] & FastMathFlags::NoSignedZeros))
+            FMF.setNoSignedZeros();
+          if (0 != (Record[OpNum] & FastMathFlags::AllowReciprocal))
+            FMF.setAllowReciprocal();
           if (FMF.any())
             I->setFastMathFlags(FMF);
         }