aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Instructions.h
diff options
context:
space:
mode:
authorMicah Villmow <villmow@gmail.com>2012-10-11 21:27:41 +0000
committerMicah Villmow <villmow@gmail.com>2012-10-11 21:27:41 +0000
commitfb384d61c78b60787ed65475d8403aee65023962 (patch)
tree7bf869f21ac85ae4ddbeea3069784c88381bd07e /include/llvm/Instructions.h
parentd9a3bad4487dee0b9ed1a0f5555dffe605826158 (diff)
downloadexternal_llvm-fb384d61c78b60787ed65475d8403aee65023962.tar.gz
external_llvm-fb384d61c78b60787ed65475d8403aee65023962.tar.bz2
external_llvm-fb384d61c78b60787ed65475d8403aee65023962.zip
Revert 165732 for further review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165747 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Instructions.h')
-rw-r--r--include/llvm/Instructions.h32
1 files changed, 3 insertions, 29 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index 9c526bd97b..6837608b2c 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -350,16 +350,7 @@ public:
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 cast<PointerType>(getPointerOperand()->getType())->getAddressSpace();
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -3662,15 +3653,7 @@ public:
/// @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 cast<PointerType>(getType())->getAddressSpace();
}
// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -3712,16 +3695,7 @@ public:
/// @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 cast<PointerType>(getOperand(0)->getType())->getAddressSpace();
}
// Methods for support type inquiry through isa, cast, and dyn_cast: