summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-11-01 10:59:30 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-11-01 10:59:30 +0000
commit1521406a4b5b08209fb817a4673f636ef0fd8f46 (patch)
tree5dd449ad899470f1106d3f72dc2cb87b0643d112 /lib/VMCore
parentacd01d1c641cabc3e02a7b4f699264d1c5a7733a (diff)
downloadllvm-1521406a4b5b08209fb817a4673f636ef0fd8f46.tar.gz
llvm-1521406a4b5b08209fb817a4673f636ef0fd8f46.tar.bz2
llvm-1521406a4b5b08209fb817a4673f636ef0fd8f46.tar.xz
Remove a weird static helper from the GEP instruction and just directly
compute the address space in the one place it was used. Also write the getPointerAddressSpace member in terms of the getPointerOperandType member. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167226 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Instructions.cpp12
1 files changed, 0 insertions, 12 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 5d063c980f..94bd2a1563 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -1399,18 +1399,6 @@ Type *GetElementPtrInst::getIndexedType(Type *Ptr, ArrayRef<uint64_t> IdxList) {
return getIndexedTypeInternal(Ptr, IdxList);
}
-unsigned GetElementPtrInst::getAddressSpace(Value *Ptr) {
- Type *Ty = Ptr->getType();
-
- if (VectorType *VTy = dyn_cast<VectorType>(Ty))
- Ty = VTy->getElementType();
-
- if (PointerType *PTy = dyn_cast<PointerType>(Ty))
- return PTy->getAddressSpace();
-
- llvm_unreachable("Invalid GEP pointer type");
-}
-
/// hasAllZeroIndices - Return true if all of the indices of this GEP are
/// zeros. If so, the result pointer and the first operand have the same
/// value, just potentially different types.