aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-23 15:42:55 +0000
committerChris Lattner <sabre@nondot.org>2003-10-23 15:42:55 +0000
commit5da69c79f9c4490c6657c207430dfeb1060fc4dd (patch)
tree587c35fd30a033fbf91bd2ea800c4422a2095fac
parent49207925b37c1424165dea46a2aea07564374319 (diff)
Fix an assertion failure in Bugpoint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9406 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/bugpoint/ExtractFunction.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp
index f031d34dec..c65b482b01 100644
--- a/tools/bugpoint/ExtractFunction.cpp
+++ b/tools/bugpoint/ExtractFunction.cpp
@@ -22,6 +22,7 @@
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Transforms/Utils/Cloning.h"
+#include "llvm/Target/TargetData.h"
#include "Support/CommandLine.h"
bool DisableSimplifyCFG = false;
@@ -72,6 +73,9 @@ Module *BugDriver::deleteInstructionFromProgram(Instruction *I,
// Spiff up the output a little bit.
PassManager Passes;
+ // Make sure that the appropriate target data is always used...
+ Passes.add(new TargetData("bugpoint", Result));
+
if (Simplification > 2 && !NoADCE)
Passes.add(createAggressiveDCEPass()); // Remove dead code...
//Passes.add(createInstructionCombiningPass());
@@ -104,6 +108,8 @@ Module *BugDriver::performFinalCleanups(Module *InM) const {
I->setLinkage(GlobalValue::ExternalLinkage);
PassManager CleanupPasses;
+ // Make sure that the appropriate target data is always used...
+ CleanupPasses.add(new TargetData("bugpoint", M));
CleanupPasses.add(createFunctionResolvingPass());
CleanupPasses.add(createGlobalDCEPass());
CleanupPasses.add(createDeadTypeEliminationPass());