[PATCH] Refactor: Simplify boolean expressions in lib/Analysis

Richard legalize at xmission.com
Sun Mar 22 13:22:01 PDT 2015


Hi alexfh, sunfish, chandlerc, resistor, nicholas, nlewycky, baldrick, bkramer,

Simplify boolean expressions using `true` and `false` with `clang-tidy`

http://reviews.llvm.org/D8528

Files:
  lib/Analysis/ScalarEvolution.cpp

Index: lib/Analysis/ScalarEvolution.cpp
===================================================================
--- lib/Analysis/ScalarEvolution.cpp
+++ lib/Analysis/ScalarEvolution.cpp
@@ -5308,12 +5308,9 @@
   if (!L->contains(I)) return false;
 
   if (isa<PHINode>(I)) {
-    if (L->getHeader() == I->getParent())
-      return true;
-    else
-      // We don't currently keep track of the control flow needed to evaluate
-      // PHIs, so we cannot handle PHIs inside of loops.
-      return false;
+    // We don't currently keep track of the control flow needed to evaluate
+    // PHIs, so we cannot handle PHIs inside of loops.
+    return L->getHeader() == I->getParent();
   }
 
   // If we won't be able to constant fold this expression even if the operands

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8528.22437.patch
Type: text/x-patch
Size: 768 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150322/8c382f23/attachment.bin>


More information about the llvm-commits mailing list