aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Type.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-14 20:10:26 +0000
committerChris Lattner <sabre@nondot.org>2004-07-14 20:10:26 +0000
commitec90d8f80d0ad5614c14db74dd22f5e3f100f2cb (patch)
tree16bdec552f796fa302a9f8593db75d96cb5fdc62 /include/llvm/Type.h
parentd9ce6adfcc77a576d1f2a33f92f110d38f2e23da (diff)
Make PATypeHolder and friends return non-const pointers to the types they
hold. Because types are basically immutable anyway, they should not be referenced as "const Type*" everywhere. Just "Type*" should suffice! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14824 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Type.h')
-rw-r--r--include/llvm/Type.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h
index c6a95b5dad..fab69aa7b6 100644
--- a/include/llvm/Type.h
+++ b/include/llvm/Type.h
@@ -347,9 +347,9 @@ inline void PATypeHolder::dropRef() {
/// type we are pointing to is forwarding to a new type. If so, we drop our
/// reference to the type.
///
-inline const Type* PATypeHolder::get() const {
+inline Type* PATypeHolder::get() const {
const Type *NewTy = Ty->getForwardedType();
- if (!NewTy) return Ty;
+ if (!NewTy) return const_cast<Type*>(Ty);
return *const_cast<PATypeHolder*>(this) = NewTy;
}