No need to special-case structs here; structs are first-class now.
authorDan Gohman <gohman@apple.com>
Fri, 4 Jun 2010 00:18:06 +0000 (00:18 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 4 Jun 2010 00:18:06 +0000 (00:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105442 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/ExtractFunction.cpp

index 7808de545ae7ff02152bd3e30cd7d3b0053c92a8..e6a98d945a37f550565cd1c941ca9b1ae28c3377 100644 (file)
@@ -73,9 +73,7 @@ Module *BugDriver::deleteInstructionFromProgram(const Instruction *I,
   Instruction *TheInst = RI;              // Got the corresponding instruction!
 
   // If this instruction produces a value, replace any users with null values
-  if (TheInst->getType()->isStructTy())
-    TheInst->replaceAllUsesWith(UndefValue::get(TheInst->getType()));
-  else if (TheInst->getType() != Type::getVoidTy(I->getContext()))
+  if (TheInst->getType() != Type::getVoidTy(I->getContext()))
     TheInst->replaceAllUsesWith(Constant::getNullValue(TheInst->getType()));
 
   // Remove the instruction from the program.