Free all Constants in ~LLVMConstantImpl. We avoid assertion failures
[oota-llvm.git] / tools / bugpoint / TestPasses.cpp
index 2c5b3b25edd1a0a989b1aec09de4fc382bc51018..900bf632a83bb1552d527469c1b3cb27bf8d6d39 100644 (file)
@@ -60,7 +60,7 @@ namespace {
       for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I)
         if (CallInst *CI = dyn_cast<CallInst>(I)) {
           if (!CI->use_empty())
-            CI->replaceAllUsesWith(Context->getNullValue(CI->getType()));
+            CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
           CI->getParent()->getInstList().erase(CI);
           break;
         }