diff options
author | Devang Patel <dpatel@apple.com> | 2009-10-13 17:02:04 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-10-13 17:02:04 +0000 |
commit | 3b122bc5f1203615e2128e0c1a63da438865b1cc (patch) | |
tree | 101331d8b919e3c86bee1a30100055ca03af4616 | |
parent | c37691068db5ceb19c014ddd3e02afa9875f8181 (diff) |
Do not check use_empty() before invoking replaceAllUsesWith().
Let replaceAllUsesWith() adjust VHs even though there are no uses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83978 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index f49a3de32b..a7a9805452 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1110,8 +1110,9 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old, NewCall->setCallingConv(CI->getCallingConv()); // Finally, remove the old call, replacing any uses with the new one. - if (!CI->use_empty()) - CI->replaceAllUsesWith(NewCall); + CI->replaceAllUsesWith(NewCall); + + CI->eraseFromParent(); } } |