Use isa instead of dyn_cast when the result is only converted to bool.
authorDan Gohman <gohman@apple.com>
Tue, 11 Aug 2009 17:20:16 +0000 (17:20 +0000)
committerDan Gohman <gohman@apple.com>
Tue, 11 Aug 2009 17:20:16 +0000 (17:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78685 91177308-0d34-0410-b5e6-96231b3b80d8

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

index a8663d2a399bb45ea6367642276324a7c1ee12b0..33ceb69feb59b96818257b68d2a38ee43291bcab 100644 (file)
@@ -363,7 +363,7 @@ public:
       // 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)
index ef29f701b52afc29c0c409b9798e4ec96cc905f3..39f4989b9b0109ee8f6d683d47543b20afea2c59 100644 (file)
@@ -997,7 +997,7 @@ bool Andersens::AnalyzeUsesOfFunction(Value *V) {
   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 @@ bool Andersens::AnalyzeUsesOfFunction(Value *V) {
     } 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;