summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r--lib/Transforms/IPO/IndMemRemoval.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Transforms/IPO/IndMemRemoval.cpp b/lib/Transforms/IPO/IndMemRemoval.cpp
index 2e09fe967f..b251ab4b09 100644
--- a/lib/Transforms/IPO/IndMemRemoval.cpp
+++ b/lib/Transforms/IPO/IndMemRemoval.cpp
@@ -51,8 +51,7 @@ bool IndMemRemPass::runOnModule(Module &M) {
//happen through intrinsics.
bool changed = false;
if (Function* F = M.getFunction("free")) {
- assert(F->isDeclaration() && "free not external?");
- if (!F->use_empty()) {
+ if (F->isDeclaration() && F->arg_size() == 1 && !F->use_empty()) {
Function* FN = Function::Create(F->getFunctionType(),
GlobalValue::LinkOnceLinkage,
"free_llvm_bounce", &M);
@@ -66,8 +65,7 @@ bool IndMemRemPass::runOnModule(Module &M) {
}
}
if (Function* F = M.getFunction("malloc")) {
- assert(F->isDeclaration() && "malloc not external?");
- if (!F->use_empty()) {
+ if (F->isDeclaration() && F->arg_size() == 1 && !F->use_empty()) {
Function* FN = Function::Create(F->getFunctionType(),
GlobalValue::LinkOnceLinkage,
"malloc_llvm_bounce", &M);