mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-04 09:45:00 +00:00
Use CloneModule's ValueMap to avoid needing to look up
functions by name. This fixes PR718. llvm-svn: 66239
This commit is contained in:
parent
87ceb6e41b
commit
5487f51dbf
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user