From: Duncan Sands Date: Wed, 7 Oct 2009 07:35:19 +0000 (+0000) Subject: Make getPointerTo return a const PointerType* rather than X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=83ed76869e678848a8139631f00dcc4ff2bf095c;p=oota-llvm.git Make getPointerTo return a const PointerType* rather than an unqualified PointerType* because it seems more correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83454 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Type.h b/include/llvm/Type.h index b8b62a3b819..4a470af9ca5 100644 --- a/include/llvm/Type.h +++ b/include/llvm/Type.h @@ -430,7 +430,7 @@ public: /// getPointerTo - Return a pointer to the current type. This is equivalent /// to PointerType::get(Foo, AddrSpace). - PointerType *getPointerTo(unsigned AddrSpace = 0) const; + const PointerType *getPointerTo(unsigned AddrSpace = 0) const; private: /// isSizedDerivedType - Derived types like structures and arrays are sized diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index b6423795cad..7afbc682d15 100644 --- a/lib/VMCore/Type.cpp +++ b/lib/VMCore/Type.cpp @@ -951,7 +951,7 @@ PointerType *PointerType::get(const Type *ValueType, unsigned AddressSpace) { return PT; } -PointerType *Type::getPointerTo(unsigned addrs) const { +const PointerType *Type::getPointerTo(unsigned addrs) const { return PointerType::get(this, addrs); }