summaryrefslogtreecommitdiff
path: root/tools/bugpoint/CrashDebugger.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-03-05 23:20:46 +0000
committerDan Gohman <gohman@apple.com>2009-03-05 23:20:46 +0000
commitef0ff140a72c18893529c33cee8e7cd634b008bd (patch)
tree4e82e0fdc2869e7ff7db373c0a5927651d8ee681 /tools/bugpoint/CrashDebugger.cpp
parent1f4af262d5ad680e33a45729a8a396bd91b09662 (diff)
downloadllvm-ef0ff140a72c18893529c33cee8e7cd634b008bd.tar.gz
llvm-ef0ff140a72c18893529c33cee8e7cd634b008bd.tar.bz2
llvm-ef0ff140a72c18893529c33cee8e7cd634b008bd.tar.xz
Fix a bugpoint bug on anonymous functions. Instead of looking up
functions in the new module by name, use the ValueMap provided by CloneModule to do the lookups. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66216 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/CrashDebugger.cpp')
-rw-r--r--tools/bugpoint/CrashDebugger.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp
index e5ae8b58dc..c290042d4c 100644
--- a/tools/bugpoint/CrashDebugger.cpp
+++ b/tools/bugpoint/CrashDebugger.cpp
@@ -264,16 +264,18 @@ namespace {
bool ReduceCrashingBlocks::TestBlocks(std::vector<const BasicBlock*> &BBs) {
// Clone the program to try hacking it apart...
- Module *M = CloneModule(BD.getProgram());
+ DenseMap<const Value*, Value*> ValueMap;
+ Module *M = CloneModule(BD.getProgram(), ValueMap);
// Convert list to set for fast lookup...
std::set<BasicBlock*> Blocks;
for (unsigned i = 0, e = BBs.size(); i != e; ++i) {
// Convert the basic block from the original module to the new module...
const Function *F = BBs[i]->getParent();
- Function *CMF = M->getFunction(F->getName());
+ Function *CMF = cast<Function>(ValueMap[F]);
assert(CMF && "Function not in module?!");
assert(CMF->getFunctionType() == F->getFunctionType() && "wrong type?");
+ assert(CMF->getName() == F->getName() && "wrong name?");
// Get the mapped basic block...
Function::iterator CBI = CMF->begin();