diff options
author | Dan Gohman <gohman@apple.com> | 2009-03-06 02:16:23 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-03-06 02:16:23 +0000 |
commit | f6dd0eb5c4a1c4824d7f83fa39586478da618ffd (patch) | |
tree | d93483cb6c69b9f23c42d5886a73fb0b608eb695 /tools | |
parent | e5abac4a86ebfcd6a6129c155393e4a95d4818d1 (diff) | |
download | llvm-f6dd0eb5c4a1c4824d7f83fa39586478da618ffd.tar.gz |
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')
-rw-r--r-- | tools/bugpoint/CrashDebugger.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index c290042d4c8d..ba12621ad93a 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); } |