Do not check use_empty() before invoking replaceAllUsesWith().
Let replaceAllUsesWith() adjust VHs even though there are no uses.
llvm-svn: 83978
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index f49a3de..a7a9805 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -1110,8 +1110,9 @@
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();
}
}