[PATCH] Refactor: Simplify boolean expressions in llvm IR

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


Hi alexfh, dexonsmith, void, rafael, dblaikie, chandlerc,

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

http://reviews.llvm.org/D8527

Files:
  lib/IR/Instructions.cpp

Index: lib/IR/Instructions.cpp
===================================================================
--- lib/IR/Instructions.cpp
+++ lib/IR/Instructions.cpp
@@ -2553,11 +2553,8 @@
   } else if (DestTy->isPointerTy()) {        // Casting to pointer
     if (SrcTy->isPointerTy()) {                // Casting from pointer
       return true;
-    } else if (SrcTy->isIntegerTy()) {         // Casting from integral
-      return true;
-    } else {                                   // Casting from something else
-      return false;
-    }
+    } else
+      return SrcTy->isIntegerTy();             // Casting from integral
   } else if (DestTy->isX86_MMXTy()) {
     if (SrcTy->isVectorTy()) {
       return DestBits == SrcBits;       // 64-bit vector to MMX

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8527.22435.patch
Type: text/x-patch
Size: 759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150322/7051e1d7/attachment.bin>


More information about the llvm-commits mailing list