[PATCH] Refactor: Simplify boolean conditional return statements in llvm/lib/Analysis

Craig Topper craig.topper at gmail.com
Mon May 25 02:52:23 PDT 2015


================
Comment at: lib/Analysis/CaptureTracking.cpp:80
@@ -79,5 +79,3 @@
       // Check whether there is a path from I to BeforeHere.
-      if (BeforeHere != I && DT->dominates(BeforeHere, I) &&
-          !isPotentiallyReachable(I, BeforeHere, DT))
-        return false;
-      return true;
+      return !(BeforeHere != I && DT->dominates(BeforeHere, I) &&
+          !isPotentiallyReachable(I, BeforeHere, DT));
----------------
Push negate through and indent second line to start after 'return' so it aligns better with the expression part of the first line.

================
Comment at: lib/Analysis/InstructionSimplify.cpp:127
@@ -131,1 +126,3 @@
+  return I->getParent() == &I->getParent()->getParent()->getEntryBlock() &&
+      !isa<InvokeInst>(I);
 }
----------------
Fix indentation to align with where the expression starts on previous line.

http://reviews.llvm.org/D9967

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list