summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-11-01 02:40:36 +0000
committerChris Lattner <sabre@nondot.org>2001-11-01 02:40:36 +0000
commit246f157af4450998355f8b4af4658744117e80fe (patch)
tree443467c7bbce3d4a56251539f1d04e09aa5fcaab /llvm/lib/Transforms
parentd307537327cccfa975061e53a4230aece1cde9c0 (diff)
downloadbcm5719-llvm-246f157af4450998355f8b4af4658744117e80fe.tar.gz
bcm5719-llvm-246f157af4450998355f8b4af4658744117e80fe.zip
Propogate name to the malloc itself instead of to the cast
llvm-svn: 1071
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/DeadTypeElimination.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp b/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp
index 42dbebd61bd..19e32c07c58 100644
--- a/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp
+++ b/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp
@@ -151,7 +151,9 @@ bool CleanupGCCOutput::doOneCleanupPass(Method *M) {
if (CallInst *CI = dyn_cast<CallInst>(I)) {
if (CI->getCalledValue() == Malloc) { // Replace call to malloc?
- MallocInst *MallocI = new MallocInst(PtrArrSByte, CI->getOperand(1));
+ MallocInst *MallocI = new MallocInst(PtrArrSByte, CI->getOperand(1),
+ CI->getName());
+ CI->setName("");
BI = BIL.insert(BI, MallocI)+1;
ReplaceInstWithInst(BIL, BI, new CastInst(MallocI, PtrSByte));
Changed = true;
OpenPOWER on IntegriCloud