summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2015-08-01 22:20:31 +0000
committerCraig Topper <craig.topper@gmail.com>2015-08-01 22:20:31 +0000
commit84a138a351d665332477e807b4292c1b1f7dd523 (patch)
tree6fb75951d7e4f2b6a14d13f9dccaa21a1b76d075 /llvm
parent53fb02390613d3f89ebe4a9fef8515b285daee49 (diff)
downloadbcm5719-llvm-84a138a351d665332477e807b4292c1b1f7dd523.tar.gz
bcm5719-llvm-84a138a351d665332477e807b4292c1b1f7dd523.zip
Mark Type::getPointerTo as const. Unfortunately, this requires a const_cast inside, but at least it makes all methods on Type const. NFC
llvm-svn: 243844
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/IR/Type.h2
-rw-r--r--llvm/lib/IR/Type.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/llvm/include/llvm/IR/Type.h b/llvm/include/llvm/IR/Type.h
index bbee3f93741..93a8a2f1865 100644
--- a/llvm/include/llvm/IR/Type.h
+++ b/llvm/include/llvm/IR/Type.h
@@ -416,7 +416,7 @@ public:
/// getPointerTo - Return a pointer to the current type. This is equivalent
/// to PointerType::get(Foo, AddrSpace).
- PointerType *getPointerTo(unsigned AddrSpace = 0);
+ PointerType *getPointerTo(unsigned AddrSpace = 0) const;
private:
/// isSizedDerivedType - Derived types like structures and arrays are sized
diff --git a/llvm/lib/IR/Type.cpp b/llvm/lib/IR/Type.cpp
index 17d24465601..553fa93f585 100644
--- a/llvm/lib/IR/Type.cpp
+++ b/llvm/lib/IR/Type.cpp
@@ -748,8 +748,8 @@ PointerType::PointerType(Type *E, unsigned AddrSpace)
assert(oldNCT == NumContainedTys && "bitfield written out of bounds?");
}
-PointerType *Type::getPointerTo(unsigned addrs) {
- return PointerType::get(this, addrs);
+PointerType *Type::getPointerTo(unsigned addrs) const {
+ return PointerType::get(const_cast<Type*>(this), addrs);
}
bool PointerType::isValidElementType(Type *ElemTy) {
OpenPOWER on IntegriCloud