[llvm-commits] [llvm] r169710 - in /llvm/trunk: include/llvm/Bitcode/LLVMBitCodes.h lib/Bitcode/Reader/BitcodeReader.cpp lib/Bitcode/Writer/BitcodeWriter.cpp
Michael Ilseman
milseman at apple.com
Sun Dec 9 12:23:16 PST 2012
Author: milseman
Date: Sun Dec 9 14:23:16 2012
New Revision: 169710
URL: http://llvm.org/viewvc/llvm-project?rev=169710&view=rev
Log:
Have the bitcode reader/writer just use FPMathOperator's fast math enum directly
Modified:
llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
Modified: llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h?rev=169710&r1=169709&r2=169710&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h (original)
+++ llvm/trunk/include/llvm/Bitcode/LLVMBitCodes.h Sun Dec 9 14:23:16 2012
@@ -242,16 +242,6 @@
PEO_EXACT = 0
};
- /// Flags for serializing FPMathOperator's
- /// SubclassOptionalData contents.
- enum FastMathFlags {
- FMF_UNSAFE_ALGEBRA = 0,
- FMF_NO_NANS = 1,
- FMF_NO_INFS = 2,
- FMF_NO_SIGNED_ZEROS = 3,
- FMF_ALLOW_RECIPROCAL = 4
- };
-
/// Encoded AtomicOrdering values.
enum AtomicOrderingCodes {
ORDERING_NOTATOMIC = 0,
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=169710&r1=169709&r2=169710&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Sun Dec 9 14:23:16 2012
@@ -2048,15 +2048,15 @@
} else if (isa<FPMathOperator>(I)) {
FastMathFlags FMF;
FMF.UnsafeAlgebra =
- 0 != (Record[OpNum] & (1 << bitc::FMF_UNSAFE_ALGEBRA));
+ 0 != (Record[OpNum] & FPMathOperator::UnsafeAlgebra);
FMF.NoNaNs =
- 0 != (Record[OpNum] & (1 << bitc::FMF_NO_NANS));
+ 0 != (Record[OpNum] & FPMathOperator::NoNaNs);
FMF.NoInfs =
- 0 != (Record[OpNum] & (1 << bitc::FMF_NO_INFS));
+ 0 != (Record[OpNum] & FPMathOperator::NoInfs);
FMF.NoSignedZeros =
- 0 != (Record[OpNum] & (1 << bitc::FMF_NO_SIGNED_ZEROS));
+ 0 != (Record[OpNum] & FPMathOperator::NoSignedZeros);
FMF.AllowReciprocal =
- 0 != (Record[OpNum] & (1 << bitc::FMF_ALLOW_RECIPROCAL));
+ 0 != (Record[OpNum] & FPMathOperator::AllowReciprocal);
if (FMF.any())
I->setFastMathFlags(FMF);
}
Modified: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp?rev=169710&r1=169709&r2=169710&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp (original)
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp Sun Dec 9 14:23:16 2012
@@ -552,15 +552,15 @@
} else if (const FPMathOperator *FPMO =
dyn_cast<const FPMathOperator>(V)) {
if (FPMO->hasUnsafeAlgebra())
- Flags |= 1 << bitc::FMF_UNSAFE_ALGEBRA;
+ Flags |= FPMathOperator::UnsafeAlgebra;
if (FPMO->hasNoNaNs())
- Flags |= 1 << bitc::FMF_NO_NANS;
+ Flags |= FPMathOperator::NoNaNs;
if (FPMO->hasNoInfs())
- Flags |= 1 << bitc::FMF_NO_INFS;
+ Flags |= FPMathOperator::NoInfs;
if (FPMO->hasNoSignedZeros())
- Flags |= 1 << bitc::FMF_NO_SIGNED_ZEROS;
+ Flags |= FPMathOperator::NoSignedZeros;
if (FPMO->hasAllowReciprocal())
- Flags |= 1 << bitc::FMF_ALLOW_RECIPROCAL;
+ Flags |= FPMathOperator::AllowReciprocal;
}
return Flags;
More information about the llvm-commits
mailing list