From 1df9859c40492511b8aa4321eb76496005d3b75b Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 16 Feb 2010 11:11:14 +0000 Subject: There are two ways of checking for a given type, for example isa(T) and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Value.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/VMCore/Value.cpp') diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp index 3759b8a7cb..1cc3d54a04 100644 --- a/lib/VMCore/Value.cpp +++ b/lib/VMCore/Value.cpp @@ -45,7 +45,7 @@ Value::Value(const Type *ty, unsigned scid) UseList(0), Name(0) { if (isa(this) || isa(this)) assert((VTy->isFirstClassType() || VTy->isVoidTy() || - isa(ty) || VTy->getTypeID() == Type::StructTyID) && + isa(ty) || VTy->isStructTy()) && "invalid CallInst type!"); else if (!isa(this) && !isa(this)) assert((VTy->isFirstClassType() || VTy->isVoidTy() || @@ -320,7 +320,7 @@ void Value::replaceAllUsesWith(Value *New) { } Value *Value::stripPointerCasts() { - if (!isa(getType())) + if (!getType()->isPointerTy()) return this; Value *V = this; do { @@ -337,12 +337,12 @@ Value *Value::stripPointerCasts() { } else { return V; } - assert(isa(V->getType()) && "Unexpected operand type!"); + assert(V->getType()->isPointerTy() && "Unexpected operand type!"); } while (1); } Value *Value::getUnderlyingObject(unsigned MaxLookup) { - if (!isa(getType())) + if (!getType()->isPointerTy()) return this; Value *V = this; for (unsigned Count = 0; MaxLookup == 0 || Count < MaxLookup; ++Count) { @@ -357,7 +357,7 @@ Value *Value::getUnderlyingObject(unsigned MaxLookup) { } else { return V; } - assert(isa(V->getType()) && "Unexpected operand type!"); + assert(V->getType()->isPointerTy() && "Unexpected operand type!"); } return V; } -- cgit v1.2.3