Fix an assertion failure in Bugpoint

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9406 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-10-23 15:42:55 +00:00
parent 49207925b3
commit 5da69c79f9

View File

@ -22,6 +22,7 @@
#include "llvm/Transforms/IPO.h" #include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Cloning.h" #include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Target/TargetData.h"
#include "Support/CommandLine.h" #include "Support/CommandLine.h"
bool DisableSimplifyCFG = false; bool DisableSimplifyCFG = false;
@ -72,6 +73,9 @@ Module *BugDriver::deleteInstructionFromProgram(Instruction *I,
// Spiff up the output a little bit. // Spiff up the output a little bit.
PassManager Passes; PassManager Passes;
// Make sure that the appropriate target data is always used...
Passes.add(new TargetData("bugpoint", Result));
if (Simplification > 2 && !NoADCE) if (Simplification > 2 && !NoADCE)
Passes.add(createAggressiveDCEPass()); // Remove dead code... Passes.add(createAggressiveDCEPass()); // Remove dead code...
//Passes.add(createInstructionCombiningPass()); //Passes.add(createInstructionCombiningPass());
@ -104,6 +108,8 @@ Module *BugDriver::performFinalCleanups(Module *InM) const {
I->setLinkage(GlobalValue::ExternalLinkage); I->setLinkage(GlobalValue::ExternalLinkage);
PassManager CleanupPasses; PassManager CleanupPasses;
// Make sure that the appropriate target data is always used...
CleanupPasses.add(new TargetData("bugpoint", M));
CleanupPasses.add(createFunctionResolvingPass()); CleanupPasses.add(createFunctionResolvingPass());
CleanupPasses.add(createGlobalDCEPass()); CleanupPasses.add(createGlobalDCEPass());
CleanupPasses.add(createDeadTypeEliminationPass()); CleanupPasses.add(createDeadTypeEliminationPass());