aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bugpoint/ExtractFunction.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-28 00:04:58 +0000
committerChris Lattner <sabre@nondot.org>2008-04-28 00:04:58 +0000
commite78109eb3a3d177d03cea40b46d9dcfc9bf32210 (patch)
treee64c760b898adf3fc9d4f1090edd3bc22003d183 /tools/bugpoint/ExtractFunction.cpp
parentf899fce0c0492a6fa405323c073b3380260e5806 (diff)
downloadexternal_llvm-e78109eb3a3d177d03cea40b46d9dcfc9bf32210.zip
external_llvm-e78109eb3a3d177d03cea40b46d9dcfc9bf32210.tar.gz
external_llvm-e78109eb3a3d177d03cea40b46d9dcfc9bf32210.tar.bz2
several multiple-retval fixes for bugpoint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50331 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ExtractFunction.cpp')
-rw-r--r--tools/bugpoint/ExtractFunction.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp
index 906826e..ca8a279 100644
--- a/tools/bugpoint/ExtractFunction.cpp
+++ b/tools/bugpoint/ExtractFunction.cpp
@@ -71,7 +71,9 @@ 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() != Type::VoidTy)
+ if (isa<StructType>(TheInst->getType()))
+ TheInst->replaceAllUsesWith(UndefValue::get(TheInst->getType()));
+ else if (TheInst->getType() != Type::VoidTy)
TheInst->replaceAllUsesWith(Constant::getNullValue(TheInst->getType()));
// Remove the instruction from the program.