Reorganize FastMathFlags to be a wrapper around unsigned, and streamline some interfaces.

llvm-svn: 169712
This commit is contained in:
Michael Ilseman
2012-12-09 21:12:04 +00:00
parent 2adb13c100
commit 65f1435a6f
8 changed files with 82 additions and 81 deletions

View 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);
}