summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-25 16:15:32 +0000
committerChris Lattner <sabre@nondot.org>2003-05-25 16:15:32 +0000
commit9608c81d01d0f0d7f8b4a9dea54d237d1a9d8276 (patch)
tree8b083835e2e58b0503dadc56edba642e48f70955 /lib/VMCore
parent28fc440bc630b50f17d911eb9adab7038a771836 (diff)
downloadllvm-9608c81d01d0f0d7f8b4a9dea54d237d1a9d8276.tar.gz
llvm-9608c81d01d0f0d7f8b4a9dea54d237d1a9d8276.tar.bz2
llvm-9608c81d01d0f0d7f8b4a9dea54d237d1a9d8276.tar.xz
Fix problem with last checkin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6328 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Constants.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 76904ad3f9..8fa5342ff3 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -668,10 +668,12 @@ void ConstantPointerNull::refineAbstractType(const DerivedType *OldTy,
Value::refineAbstractType(OldTy, NewTy);
// Make everyone now use a constant of the new type...
- replaceAllUsesWith(ConstantPointerNull::get(cast<PointerType>(NewTy)));
-
- // This constant is now dead, destroy it.
- destroyConstant();
+ if (NewTy != OldTy) {
+ replaceAllUsesWith(ConstantPointerNull::get(cast<PointerType>(NewTy)));
+
+ // This constant is now dead, destroy it.
+ destroyConstant();
+ }
}