mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-04 11:17:31 +00:00
Use std::unique_ptr. NFC.
llvm-svn: 325165
This commit is contained in:
parent
5786faace5
commit
0e867383d9
@ -242,7 +242,7 @@ bool ReduceCrashingFunctions::TestFuncs(std::vector<Function *> &Funcs) {
|
||||
|
||||
// Clone the program to try hacking it apart...
|
||||
ValueToValueMapTy VMap;
|
||||
Module *M = CloneModule(*BD.getProgram(), VMap).release();
|
||||
std::unique_ptr<Module> M = CloneModule(*BD.getProgram(), VMap);
|
||||
|
||||
// Convert list to set for fast lookup...
|
||||
std::set<Function *> Functions;
|
||||
@ -301,19 +301,18 @@ bool ReduceCrashingFunctions::TestFuncs(std::vector<Function *> &Funcs) {
|
||||
}
|
||||
|
||||
// Finally, remove any null members from any global intrinsic.
|
||||
RemoveFunctionReferences(M, "llvm.used");
|
||||
RemoveFunctionReferences(M, "llvm.compiler.used");
|
||||
RemoveFunctionReferences(M.get(), "llvm.used");
|
||||
RemoveFunctionReferences(M.get(), "llvm.compiler.used");
|
||||
}
|
||||
// Try running the hacked up program...
|
||||
if (TestFn(BD, M)) {
|
||||
BD.setNewProgram(M); // It crashed, keep the trimmed version...
|
||||
if (TestFn(BD, M.get())) {
|
||||
BD.setNewProgram(M.release()); // It crashed, keep the trimmed version...
|
||||
|
||||
// Make sure to use function pointers that point into the now-current
|
||||
// module.
|
||||
Funcs.assign(Functions.begin(), Functions.end());
|
||||
return true;
|
||||
}
|
||||
delete M;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user