diff options
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/Expressions.cpp | 4 | ||||
-rw-r--r-- | lib/Analysis/IPA/FindUnsafePointerTypes.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/InductionVariable.cpp | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/Analysis/Expressions.cpp b/lib/Analysis/Expressions.cpp index 006a9920b5..cd68d04f8a 100644 --- a/lib/Analysis/Expressions.cpp +++ b/lib/Analysis/Expressions.cpp @@ -76,7 +76,7 @@ struct DefOne : public DefVal { // happen for values in the range of 0 to 127. // static ConstantInt *getUnsignedConstant(uint64_t V, const Type *Ty) { - if (Ty->isPointerType()) Ty = Type::ULongTy; + if (isa<PointerType>(Ty)) Ty = Type::ULongTy; if (Ty->isSigned()) { // If this value is not a valid unsigned value for this type, return null! if (V > 127 && ((int64_t)V < 0 || @@ -320,7 +320,7 @@ ExprType analysis::ClassifyExpression(Value *Expr) { case Instruction::Cast: { ExprType Src(ClassifyExpression(I->getOperand(0))); const Type *DestTy = I->getType(); - if (DestTy->isPointerType()) + if (isa<PointerType>(DestTy)) DestTy = Type::ULongTy; // Pointer types are represented as ulong /* diff --git a/lib/Analysis/IPA/FindUnsafePointerTypes.cpp b/lib/Analysis/IPA/FindUnsafePointerTypes.cpp index 627c7ff5f3..1723a8edac 100644 --- a/lib/Analysis/IPA/FindUnsafePointerTypes.cpp +++ b/lib/Analysis/IPA/FindUnsafePointerTypes.cpp @@ -57,7 +57,7 @@ bool FindUnsafePointerTypes::run(Module *Mod) { for (const_inst_iterator I = inst_begin(M), E = inst_end(M); I != E; ++I) { const Instruction *Inst = *I; const Type *ITy = Inst->getType(); - if (ITy->isPointerType() && !UnsafeTypes.count((PointerType*)ITy)) + if (isa<PointerType>(ITy) && !UnsafeTypes.count((PointerType*)ITy)) if (!isSafeInstruction(Inst)) { UnsafeTypes.insert((PointerType*)ITy); diff --git a/lib/Analysis/InductionVariable.cpp b/lib/Analysis/InductionVariable.cpp index f0b01e8455..b3da95f090 100644 --- a/lib/Analysis/InductionVariable.cpp +++ b/lib/Analysis/InductionVariable.cpp @@ -99,7 +99,7 @@ InductionVariable::InductionVariable(PHINode *P, LoopInfo *LoopInfo) { // Okay, we have found an induction variable. Save the start and step values const Type *ETy = Phi->getType(); - if (ETy->isPointerType()) ETy = Type::ULongTy; + if (isa<PointerType>(ETy)) ETy = Type::ULongTy; Start = (Value*)(E1.Offset ? E1.Offset : ConstantInt::get(ETy, 0)); Step = (Value*)(E2.Offset ? E2.Offset : ConstantInt::get(ETy, 0)); @@ -132,7 +132,7 @@ InductionVariable::InductionVariable(PHINode *P, LoopInfo *LoopInfo) { StepE.Var != Phi) return; const Type *ETy = Phi->getType(); - if (ETy->isPointerType()) ETy = Type::ULongTy; + if (isa<PointerType>(ETy)) ETy = Type::ULongTy; Step = (Value*)(StepE.Offset ? StepE.Offset : ConstantInt::get(ETy, 0)); } else { // We were able to get a step value, simplify with expr analysis ExprType StepE = analysis::ClassifyExpression(Step); @@ -145,7 +145,7 @@ InductionVariable::InductionVariable(PHINode *P, LoopInfo *LoopInfo) { else Step = Constant::getNullValue(Step->getType()); const Type *ETy = Phi->getType(); - if (ETy->isPointerType()) ETy = Type::ULongTy; + if (isa<PointerType>(ETy)) ETy = Type::ULongTy; Step = (Value*)(StepE.Offset ? StepE.Offset : ConstantInt::get(ETy,0)); } } |