You can call Type::getContainedType(int) to access the destination type. Therefore, it should look like this:
bool isPointerToPointer(const Value* V) { const Type* T = V->getType(); return T->isPointerTy() && T->getContainedType(0)->isPointerTy(); }
source share