[llvm-commits] [llvm] r78685 - in /llvm/trunk: include/llvm/Support/IRBuilder.h lib/Analysis/IPA/Andersens.cpp

Dan Gohman gohman at apple.com
Tue Aug 11 10:20:17 PDT 2009


Author: djg
Date: Tue Aug 11 12:20:16 2009
New Revision: 78685

URL: http://llvm.org/viewvc/llvm-project?rev=78685&view=rev
Log:
Use isa instead of dyn_cast when the result is only converted to bool.

Modified:
    llvm/trunk/include/llvm/Support/IRBuilder.h
    llvm/trunk/lib/Analysis/IPA/Andersens.cpp

Modified: llvm/trunk/include/llvm/Support/IRBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=78685&r1=78684&r2=78685&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/IRBuilder.h (original)
+++ llvm/trunk/include/llvm/Support/IRBuilder.h Tue Aug 11 12:20:16 2009
@@ -363,7 +363,7 @@
       // Every index must be constant.
       InputIterator i;
       for (i = IdxBegin; i < IdxEnd; ++i) {
-        if (!dyn_cast<Constant>(*i))
+        if (!isa<Constant>(*i))
           break;
       }
       if (i == IdxEnd)

Modified: llvm/trunk/lib/Analysis/IPA/Andersens.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/IPA/Andersens.cpp?rev=78685&r1=78684&r2=78685&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/IPA/Andersens.cpp (original)
+++ llvm/trunk/lib/Analysis/IPA/Andersens.cpp Tue Aug 11 12:20:16 2009
@@ -997,7 +997,7 @@
   if (!isa<PointerType>(V->getType())) return true;
 
   for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI)
-    if (dyn_cast<LoadInst>(*UI)) {
+    if (isa<LoadInst>(*UI)) {
       return false;
     } else if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
       if (V == SI->getOperand(1)) {
@@ -1028,7 +1028,7 @@
     } else if (ICmpInst *ICI = dyn_cast<ICmpInst>(*UI)) {
       if (!isa<ConstantPointerNull>(ICI->getOperand(1)))
         return true;  // Allow comparison against null.
-    } else if (dyn_cast<FreeInst>(*UI)) {
+    } else if (isa<FreeInst>(*UI)) {
       return false;
     } else {
       return true;





More information about the llvm-commits mailing list