remove useless cast and fix typos in comment
authorGabor Greif <ggreif@gmail.com>
Fri, 9 Jul 2010 16:42:04 +0000 (16:42 +0000)
committerGabor Greif <ggreif@gmail.com>
Fri, 9 Jul 2010 16:42:04 +0000 (16:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107989 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolutionExpander.cpp

index 4a7b5f7ce5ee53852d575d72a265a31a67da885e..d4a4b26e25ec442cde1d792d72a54e7b9ad941bb 100644 (file)
 #include "llvm/ADT/STLExtras.h"
 using namespace llvm;
 
-/// ReuseOrCreateCast - Arange for there to be a cast of V to Ty at IP,
+/// ReuseOrCreateCast - Arrange for there to be a cast of V to Ty at IP,
 /// reusing an existing cast if a suitable one exists, moving an existing
 /// cast if a suitable one exists but isn't in the right place, or
-/// or creating a new one.
+/// creating a new one.
 Value *SCEVExpander::ReuseOrCreateCast(Value *V, const Type *Ty,
                                        Instruction::CastOps Op,
                                        BasicBlock::iterator IP) {
@@ -33,7 +33,7 @@ Value *SCEVExpander::ReuseOrCreateCast(Value *V, const Type *Ty,
        UI != E; ++UI) {
     User *U = *UI;
     if (U->getType() == Ty)
-      if (CastInst *CI = dyn_cast<CastInst>(cast<Instruction>(U)))
+      if (CastInst *CI = dyn_cast<CastInst>(U))
         if (CI->getOpcode() == Op) {
           // If the cast isn't where we want it, fix it.
           if (BasicBlock::iterator(CI) != IP) {