AllocType);
}
- const llvm::Type *ElementPtrTy = ConvertType(AllocType)->getPointerTo(AS);
+ const llvm::Type *ElementPtrTy
+ = ConvertTypeForMem(AllocType)->getPointerTo(AS);
NewPtr = Builder.CreateBitCast(NewPtr, ElementPtrTy);
if (E->isArray()) {
EmitNewInitializer(*this, E, NewPtr, NumElements, AllocSizeWithoutCookie);
// NewPtr is a pointer to the base element type. If we're
// allocating an array of arrays, we'll need to cast back to the
// array pointer type.
- const llvm::Type *ResultTy = ConvertType(E->getType());
+ const llvm::Type *ResultTy = ConvertTypeForMem(E->getType());
if (NewPtr->getType() != ResultTy)
NewPtr = Builder.CreateBitCast(NewPtr, ResultTy);
} else {
// CHECK: call void @_ZN5AllocD1Ev(
// CHECK: call void @_ZN5AllocdaEPv(i8*
delete[] new Alloc[10][20];
+ // CHECK: call noalias i8* @_Znwm
+ // CHECK: call void @_ZdlPv(i8*
+ delete new bool;
+ // CHECK: ret void
}