correct const-ness with auto and dyn_cast

1. Use const with autos.
2. Don't bother with explicit const in cast ops because they do it automagically.

Thanks, David B. / Aaron B. / Reid K.

llvm-svn: 219817
This commit is contained in:
Sanjay Patel 2014-10-15 17:45:13 +00:00
parent 3b7fc86677
commit c00017d1f6
1 changed files with 3 additions and 3 deletions

View File

@ -710,15 +710,15 @@ static void WriteModuleInfo(const Module *M, const ValueEnumerator &VE,
static uint64_t GetOptimizationFlags(const Value *V) {
uint64_t Flags = 0;
if (auto *OBO = dyn_cast<OverflowingBinaryOperator>(V)) {
if (const auto *OBO = dyn_cast<OverflowingBinaryOperator>(V)) {
if (OBO->hasNoSignedWrap())
Flags |= 1 << bitc::OBO_NO_SIGNED_WRAP;
if (OBO->hasNoUnsignedWrap())
Flags |= 1 << bitc::OBO_NO_UNSIGNED_WRAP;
} else if (auto *PEO = dyn_cast<PossiblyExactOperator>(V)) {
} else if (const auto *PEO = dyn_cast<PossiblyExactOperator>(V)) {
if (PEO->isExact())
Flags |= 1 << bitc::PEO_EXACT;
} else if (auto *FPMO = dyn_cast<const FPMathOperator>(V)) {
} else if (const auto *FPMO = dyn_cast<FPMathOperator>(V)) {
if (FPMO->hasUnsafeAlgebra())
Flags |= FastMathFlags::UnsafeAlgebra;
if (FPMO->hasNoNaNs())