1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Fix test failure on windows -- do not return deleted func

llvm-svn: 302999
This commit is contained in:
Xinliang David Li 2017-05-14 02:54:02 +00:00
parent 30b209f262
commit a4047145f7

View File

@ -715,9 +715,15 @@ Function *PartialInlinerImpl::unswitchFunction(Function *F) {
// users (function pointers, etc.) back to the original function.
DuplicateFunction->replaceAllUsesWith(F);
DuplicateFunction->eraseFromParent();
if (!AnyInline && OutlinedFunction)
if (AnyInline)
return OutlinedFunction;
// Remove the function that is speculatively created:
if (OutlinedFunction)
OutlinedFunction->eraseFromParent();
return OutlinedFunction;
return nullptr;
}
bool PartialInlinerImpl::tryPartialInline(Function *DuplicateFunction,