diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-04-28 00:04:58 +0000 | 
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-04-28 00:04:58 +0000 | 
| commit | 7855a5cb70d42e48e691fbca273e8c3edbbda7f1 (patch) | |
| tree | 116608b7bf5c4d1c79d8ccde99ba0476e78968a3 /llvm/tools/bugpoint/CrashDebugger.cpp | |
| parent | d04b818a91aa5dcb78165f5d3ff5502f99090f45 (diff) | |
| download | bcm5719-llvm-7855a5cb70d42e48e691fbca273e8c3edbbda7f1.tar.gz bcm5719-llvm-7855a5cb70d42e48e691fbca273e8c3edbbda7f1.zip | |
several multiple-retval fixes for bugpoint.
llvm-svn: 50331
Diffstat (limited to 'llvm/tools/bugpoint/CrashDebugger.cpp')
| -rw-r--r-- | llvm/tools/bugpoint/CrashDebugger.cpp | 19 | 
1 files changed, 9 insertions, 10 deletions
| diff --git a/llvm/tools/bugpoint/CrashDebugger.cpp b/llvm/tools/bugpoint/CrashDebugger.cpp index d86d1c5969c..7dcbfe3c4a6 100644 --- a/llvm/tools/bugpoint/CrashDebugger.cpp +++ b/llvm/tools/bugpoint/CrashDebugger.cpp @@ -14,7 +14,7 @@  #include "BugDriver.h"  #include "ToolRunner.h"  #include "ListReducer.h" -#include "llvm/Constant.h" +#include "llvm/Constants.h"  #include "llvm/DerivedTypes.h"  #include "llvm/Instructions.h"  #include "llvm/Module.h" @@ -300,17 +300,16 @@ bool ReduceCrashingBlocks::TestBlocks(std::vector<const BasicBlock*> &BBs) {          for (succ_iterator SI = succ_begin(BB), E = succ_end(BB); SI != E; ++SI)            (*SI)->removePredecessor(BB); -        if (BB->getTerminator()->getType() != Type::VoidTy) -          BB->getTerminator()->replaceAllUsesWith( -                      Constant::getNullValue(BB->getTerminator()->getType())); +        TerminatorInst *BBTerm = BB->getTerminator(); +         +        if (isa<StructType>(BBTerm->getType())) +           BBTerm->replaceAllUsesWith(UndefValue::get(BBTerm->getType())); +        else if (BB->getTerminator()->getType() != Type::VoidTy) +          BBTerm->replaceAllUsesWith(Constant::getNullValue(BBTerm->getType())); -        // Delete the old terminator instruction... +        // Replace the old terminator instruction.          BB->getInstList().pop_back(); - -        // Add a new return instruction of the appropriate type... -        const Type *RetTy = BB->getParent()->getReturnType(); -        ReturnInst::Create(RetTy == Type::VoidTy ? 0 : -                           Constant::getNullValue(RetTy), BB); +        new UnreachableInst(BB);        }    // The CFG Simplifier pass may delete one of the basic blocks we are | 

