aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/IPO/MutateStructTypes.cpp6
-rw-r--r--lib/Transforms/IPO/OldPoolAllocate.cpp5
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/Transforms/IPO/MutateStructTypes.cpp b/lib/Transforms/IPO/MutateStructTypes.cpp
index e5bad67..08ff6b8 100644
--- a/lib/Transforms/IPO/MutateStructTypes.cpp
+++ b/lib/Transforms/IPO/MutateStructTypes.cpp
@@ -399,12 +399,14 @@ void MutateStructTypes::transformFunction(Function *m) {
// Memory Instructions
case Instruction::Alloca:
NewI =
- new AllocaInst(ConvertType(I.getType()),
+ new MallocInst(
+ ConvertType(cast<PointerType>(I.getType())->getElementType()),
I.getNumOperands() ? ConvertValue(I.getOperand(0)) :0);
break;
case Instruction::Malloc:
NewI =
- new MallocInst(ConvertType(I.getType()),
+ new MallocInst(
+ ConvertType(cast<PointerType>(I.getType())->getElementType()),
I.getNumOperands() ? ConvertValue(I.getOperand(0)) :0);
break;
diff --git a/lib/Transforms/IPO/OldPoolAllocate.cpp b/lib/Transforms/IPO/OldPoolAllocate.cpp
index 67ba0f1..33110bd 100644
--- a/lib/Transforms/IPO/OldPoolAllocate.cpp
+++ b/lib/Transforms/IPO/OldPoolAllocate.cpp
@@ -1639,9 +1639,8 @@ void PoolAllocate::CreatePools(Function *F, const vector<AllocDSNode*> &Allocs,
"Pool type should not be abstract anymore!");
// Add an allocation and a free for each pool...
- AllocaInst *PoolAlloc
- = new AllocaInst(PointerType::get(PI.PoolType), 0,
- CurModule->getTypeName(PI.PoolType));
+ AllocaInst *PoolAlloc = new AllocaInst(PI.PoolType, 0,
+ CurModule->getTypeName(PI.PoolType));
PI.Handle = PoolAlloc;
EntryNodeInsts.push_back(PoolAlloc);
AllocationInst *AI = Allocs[i]->getAllocation();