summaryrefslogtreecommitdiff
path: root/tools/bugpoint/CrashDebugger.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-03-06 02:16:23 +0000
committerDan Gohman <gohman@apple.com>2009-03-06 02:16:23 +0000
commitf6dd0eb5c4a1c4824d7f83fa39586478da618ffd (patch)
treed93483cb6c69b9f23c42d5886a73fb0b608eb695 /tools/bugpoint/CrashDebugger.cpp
parente5abac4a86ebfcd6a6129c155393e4a95d4818d1 (diff)
downloadllvm-f6dd0eb5c4a1c4824d7f83fa39586478da618ffd.tar.gz
llvm-f6dd0eb5c4a1c4824d7f83fa39586478da618ffd.tar.bz2
llvm-f6dd0eb5c4a1c4824d7f83fa39586478da618ffd.tar.xz
Use CloneModule's ValueMap to avoid needing to look up
functions by name. This fixes PR718. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66239 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/CrashDebugger.cpp')
-rw-r--r--tools/bugpoint/CrashDebugger.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp
index c290042d4c..ba12621ad9 100644
--- a/tools/bugpoint/CrashDebugger.cpp
+++ b/tools/bugpoint/CrashDebugger.cpp
@@ -198,17 +198,16 @@ bool ReduceCrashingFunctions::TestFuncs(std::vector<Function*> &Funcs) {
return false;
// 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<Function*> Functions;
for (unsigned i = 0, e = Funcs.size(); i != e; ++i) {
- // FIXME: bugpoint should add names to all stripped symbols.
- assert(!Funcs[i]->getName().empty() &&
- "Bugpoint doesn't work on stripped modules yet PR718!");
- Function *CMF = M->getFunction(Funcs[i]->getName());
+ Function *CMF = cast<Function>(ValueMap[Funcs[i]]);
assert(CMF && "Function not in module?!");
assert(CMF->getFunctionType() == Funcs[i]->getFunctionType() && "wrong ty");
+ assert(CMF->getName() == Funcs[i]->getName() && "wrong name");
Functions.insert(CMF);
}