Make getPointerTo return a const PointerType* rather than
authorDuncan Sands <baldrick@free.fr>
Wed, 7 Oct 2009 07:35:19 +0000 (07:35 +0000)
committerDuncan Sands <baldrick@free.fr>
Wed, 7 Oct 2009 07:35:19 +0000 (07:35 +0000)
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

include/llvm/Type.h
lib/VMCore/Type.cpp

index b8b62a3b819026520437bc1737895671c3a0f4f4..4a470af9ca5b0f3f534d866e9df63e0c582bf581 100644 (file)
@@ -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
index b6423795cadca59f6b6aeb962383ce1c4b41a411..7afbc682d15d7ce11ec4ad6e2f8315dfa7dc0ac1 100644 (file)
@@ -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);
 }