static unsigned getPointerOperandIndex() { return 0U; }
unsigned getPointerAddressSpace() const {
- return cast<PointerType>(getPointerOperand()->getType())->getAddressSpace();
+ return getPointerOperand()->getType()->getPointerAddressSpace();
}
static unsigned getPointerOperandIndex() { return 1U; }
unsigned getPointerAddressSpace() const {
- if (getPointerOperand()->getType()->isPointerTy())
- return cast<PointerType>(getPointerOperand()->getType())
- ->getAddressSpace();
- if (getPointerOperand()->getType()->isVectorTy()
- && cast<VectorType>(getPointerOperand()->getType())->isPointerTy())
- return cast<PointerType>(cast<VectorType>(
- getPointerOperand()->getType())->getElementType())
- ->getAddressSpace();
- llvm_unreachable("Only a vector of pointers or pointers can be used!");
- return 0;
+ return getPointerOperand()->getType()->getPointerAddressSpace();
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
const Value *getNewValOperand() const { return getOperand(2); }
unsigned getPointerAddressSpace() const {
- return cast<PointerType>(getPointerOperand()->getType())->getAddressSpace();
+ return getPointerOperand()->getType()->getPointerAddressSpace();
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
const Value *getValOperand() const { return getOperand(1); }
unsigned getPointerAddressSpace() const {
- return cast<PointerType>(getPointerOperand()->getType())->getAddressSpace();
+ return getPointerOperand()->getType()->getPointerAddressSpace();
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
}
unsigned getPointerAddressSpace() const {
- return cast<PointerType>(getPointerOperandType())->getAddressSpace();
+ return getPointerOperand()->getType()->getPointerAddressSpace();
}
/// getPointerOperandType - Method to return the pointer operand as a
/// @brief return the address space of the pointer.
unsigned getAddressSpace() const {
- if (getType()->isPointerTy())
- return cast<PointerType>(getType())->getAddressSpace();
- if (getType()->isVectorTy() &&
- cast<VectorType>(getType())->getElementType()->isPointerTy())
- return cast<PointerType>(
- cast<VectorType>(getType())->getElementType())
- ->getAddressSpace();
- llvm_unreachable("Must be a pointer or a vector of pointers.");
- return 0;
+ return getType()->getPointerAddressSpace();
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
/// @brief return the address space of the pointer.
unsigned getPointerAddressSpace() const {
- Type *Ty = getOperand(0)->getType();
- if (Ty->isPointerTy())
- return cast<PointerType>(Ty)->getAddressSpace();
- if (Ty->isVectorTy()
- && cast<VectorType>(Ty)->getElementType()->isPointerTy())
- return cast<PointerType>(
- cast<VectorType>(Ty)->getElementType())
- ->getAddressSpace();
- llvm_unreachable("Must be a pointer or a vector of pointers.");
- return 0;
+ return getOperand(0)->getType()->getPointerAddressSpace();
}
// Methods for support type inquiry through isa, cast, and dyn_cast: