From: Dan Gohman Date: Tue, 11 Aug 2009 17:20:16 +0000 (+0000) Subject: Use isa instead of dyn_cast when the result is only converted to bool. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=104eac156e7be298b80280669d7d081fb32e0a65;p=oota-llvm.git Use isa instead of dyn_cast when the result is only converted to bool. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78685 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index a8663d2a399..33ceb69feb5 100644 --- a/include/llvm/Support/IRBuilder.h +++ b/include/llvm/Support/IRBuilder.h @@ -363,7 +363,7 @@ public: // Every index must be constant. InputIterator i; for (i = IdxBegin; i < IdxEnd; ++i) { - if (!dyn_cast(*i)) + if (!isa(*i)) break; } if (i == IdxEnd) diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp index ef29f701b52..39f4989b9b0 100644 --- a/lib/Analysis/IPA/Andersens.cpp +++ b/lib/Analysis/IPA/Andersens.cpp @@ -997,7 +997,7 @@ bool Andersens::AnalyzeUsesOfFunction(Value *V) { if (!isa(V->getType())) return true; for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI) - if (dyn_cast(*UI)) { + if (isa(*UI)) { return false; } else if (StoreInst *SI = dyn_cast(*UI)) { if (V == SI->getOperand(1)) { @@ -1028,7 +1028,7 @@ bool Andersens::AnalyzeUsesOfFunction(Value *V) { } else if (ICmpInst *ICI = dyn_cast(*UI)) { if (!isa(ICI->getOperand(1))) return true; // Allow comparison against null. - } else if (dyn_cast(*UI)) { + } else if (isa(*UI)) { return false; } else { return true;