Teach Type::getPointerAddressSpace to look through pointer vectors

politely and document this feature.

This simple API extension then allows us to write all of the
Instructions' address space query methods much more simply. No
functionality change intended here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167223 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chandler Carruth
2012-11-01 09:37:49 +00:00
parent 426c2bf5cd
commit 8fb614cb3b
3 changed files with 11 additions and 35 deletions

View File

@@ -346,8 +346,10 @@ public:
unsigned getVectorNumElements() const;
Type *getVectorElementType() const { return getSequentialElementType(); }
unsigned getPointerAddressSpace() const;
Type *getPointerElementType() const { return getSequentialElementType(); }
/// \brief Get the address space of this pointer or pointer vector type.
unsigned getPointerAddressSpace() const;
//===--------------------------------------------------------------------===//
// Static members exported by the Type class itself. Useful for getting