Check in fix for bug: test/Regression/Assembler/ValueRefineAbsType.ll
authorChris Lattner <sabre@nondot.org>
Fri, 25 Jan 2002 03:45:27 +0000 (03:45 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 25 Jan 2002 03:45:27 +0000 (03:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1582 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Value.cpp

index af9d2e4f628576ca0ba3fe8fd58e4f24da1a347c..c4327a1814dc16870bf32f71b3468def16b4a4c5 100644 (file)
@@ -8,7 +8,7 @@
 #include "llvm/InstrTypes.h"
 #include "llvm/SymbolTable.h"
 #include "llvm/SymTabValue.h"
-#include "llvm/Type.h"
+#include "llvm/DerivedTypes.h"
 #ifndef NDEBUG      // Only in -g mode...
 #include "llvm/Assembly/Writer.h"
 #include <iostream>
@@ -71,7 +71,9 @@ void Value::replaceAllUsesWith(Value *D) {
 // change Ty to point to the right type.  :)
 //
 void Value::refineAbstractType(const DerivedType *OldTy, const Type *NewTy) {
-  assert(Ty.get() == (const Type*)OldTy &&"Can't refine anything but my type!");
+  assert(Ty.get() == OldTy &&"Can't refine anything but my type!");
+  if (OldTy == NewTy && !OldTy->isAbstract())
+    Ty.removeUserFromConcrete();
   Ty = NewTy;
 }