Avoid an unnecessary isa<Constant>.
authorReid Spencer <rspencer@reidspencer.com>
Sun, 18 Jul 2004 08:31:18 +0000 (08:31 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sun, 18 Jul 2004 08:31:18 +0000 (08:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14963 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/IPConstantPropagation.cpp

index 0195231701f1cccab696638e4a2cdb577885555d..36ac2023c1d7cac515c859e86cf631c5adc7dc18 100644 (file)
@@ -82,9 +82,7 @@ bool IPCP::processFunction(Function &F) {
         if (*AI == &F) return false;  // Passes the function into itself
 
         if (!ArgumentConstants[i].second) {
-          if (isa<Constant>(*AI)) {
-            Constant *C = dyn_cast<Constant>(*AI);
-            
+          if (Constant *C = dyn_cast<Constant>(*AI)) {
             if (!ArgumentConstants[i].first)
               ArgumentConstants[i].first = C;
             else if (ArgumentConstants[i].first != C) {