[llvm] r270779 - [LazyValueInfo] Simplify `return after else`. NFCI.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Wed May 25 15:29:35 PDT 2016


Author: davide
Date: Wed May 25 17:29:34 2016
New Revision: 270779

URL: http://llvm.org/viewvc/llvm-project?rev=270779&view=rev
Log:
[LazyValueInfo] Simplify `return after else`. NFCI.

Modified:
    llvm/trunk/lib/Analysis/LazyValueInfo.cpp

Modified: llvm/trunk/lib/Analysis/LazyValueInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LazyValueInfo.cpp?rev=270779&r1=270778&r2=270779&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LazyValueInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/LazyValueInfo.cpp Wed May 25 17:29:34 2016
@@ -287,7 +287,7 @@ raw_ostream &operator<<(raw_ostream &OS,
 
   if (Val.isNotConstant())
     return OS << "notconstant<" << *Val.getNotConstant() << '>';
-  else if (Val.isConstantRange())
+  if (Val.isConstantRange())
     return OS << "constantrange<" << Val.getConstantRange().getLower() << ", "
               << Val.getConstantRange().getUpper() << '>';
   return OS << "constant<" << *Val.getConstant() << '>';
@@ -678,7 +678,7 @@ bool LazyValueInfoCache::solveBlockValue
     insertResult(Val, BB, Res);
     return true;
   }
-  else if (BBI->getType()->isIntegerTy()) {
+  if (BBI->getType()->isIntegerTy()) {
     if (isa<CastInst>(BBI)) {
       if (!solveBlockValueCast(Res, BBI, BB))
         return false;
@@ -1497,8 +1497,7 @@ ConstantRange LazyValueInfo::getConstant
     return ConstantRange(Width, /*isFullSet=*/false);
   if (Result.isConstantRange())
     return Result.getConstantRange();
-  else
-    return ConstantRange(Width, /*isFullSet=*/true);
+  return ConstantRange(Width, /*isFullSet=*/true);
 }
 
 /// Determine whether the specified value is known to be a




More information about the llvm-commits mailing list