Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3710 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y
index 34929c0..de5f469 100644
--- a/lib/AsmParser/llvmAsmParser.y
+++ b/lib/AsmParser/llvmAsmParser.y
@@ -1630,22 +1630,19 @@
};
MemoryInst : MALLOC Types {
- $$ = new MallocInst(PointerType::get(*$2));
+ $$ = new MallocInst(*$2);
delete $2;
}
| MALLOC Types ',' UINT ValueRef {
- const Type *Ty = PointerType::get(*$2);
- $$ = new MallocInst(Ty, getVal($4, $5));
+ $$ = new MallocInst(*$2, getVal($4, $5));
delete $2;
}
| ALLOCA Types {
- $$ = new AllocaInst(PointerType::get(*$2));
+ $$ = new AllocaInst(*$2);
delete $2;
}
| ALLOCA Types ',' UINT ValueRef {
- const Type *Ty = PointerType::get(*$2);
- Value *ArrSize = getVal($4, $5);
- $$ = new AllocaInst(Ty, ArrSize);
+ $$ = new AllocaInst(*$2, getVal($4, $5));
delete $2;
}
| FREE ResolvedVal {