aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-04-26 22:46:23 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-04-26 22:46:23 +0000
commita525f6d8f556a05cc453621adc8e0bd785c30123 (patch)
tree4f9197879d6455824365ae8b042586addf4be0d1
parenta8d451e1d4c5fbec7fbfefbb07a392cbb3c83bc4 (diff)
memcpy returns void!!!!!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21574 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/IPO/SimplifyLibCalls.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/Transforms/IPO/SimplifyLibCalls.cpp b/lib/Transforms/IPO/SimplifyLibCalls.cpp
index cc638be9a9..a776d38dc5 100644
--- a/lib/Transforms/IPO/SimplifyLibCalls.cpp
+++ b/lib/Transforms/IPO/SimplifyLibCalls.cpp
@@ -205,8 +205,7 @@ namespace {
args.push_back(PointerType::get(Type::SByteTy));
args.push_back(Type::IntTy);
args.push_back(Type::IntTy);
- memcpy_type = FunctionType::get(
- PointerType::get(Type::SByteTy), args, false);
+ memcpy_type = FunctionType::get(Type::VoidTy, args, false);
}
return memcpy_type;
}
@@ -568,10 +567,7 @@ public:
switch (len)
{
case 0:
- // Just replace with the destination parameter since a zero length
- // memcpy is a no-op.
- ci->replaceAllUsesWith(
- new CastInst(dest,PointerType::get(Type::VoidTy),"",ci));
+ // The memcpy is a no-op so just dump its call.
ci->eraseFromParent();
return true;
case 1:
@@ -595,8 +591,6 @@ public:
}
LoadInst* LI = new LoadInst(SrcCast,"",ci);
StoreInst* SI = new StoreInst(LI, DestCast, ci);
- ci->replaceAllUsesWith(
- new CastInst(dest,PointerType::get(Type::VoidTy),"",ci));
ci->eraseFromParent();
return true;
}