diff options
-rw-r--r-- | include/llvm/Type.h | 4 | ||||
-rw-r--r-- | lib/VMCore/Type.cpp | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h index a284d80..e80c876 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -364,6 +364,10 @@ public: /// void removeAbstractTypeUser(AbstractTypeUser *U) const; + /// getPointerTo - Return a pointer to the current type. This is equivalent + /// to PointerType::get(Foo, AddrSpace). + PointerType *getPointerTo(unsigned AddrSpace = 0) const; + private: /// isSizedDerivedType - Derived types like structures and arrays are sized /// iff all of the members of the type are sized as well. Since asking for diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index 642fc19..edd8cf3 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -1214,6 +1214,10 @@ PointerType *PointerType::get(const Type *ValueType, unsigned AddressSpace) { return PT; } +PointerType *Type::getPointerTo(unsigned addrs) const { + return PointerType::get(this, addrs); +} + //===----------------------------------------------------------------------===// // Derived Type Refinement Functions //===----------------------------------------------------------------------===// |