remove useless cast and fix typos in comment

llvm-svn: 107989
This commit is contained in:
Gabor Greif 2010-07-09 16:42:04 +00:00
parent 3b740e9085
commit 8e66a42784
1 changed files with 3 additions and 3 deletions

View File

@ -21,10 +21,10 @@
#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) {