forked from OSchip/llvm-project
parent
7020eae076
commit
b918900995
|
@ -516,8 +516,8 @@ static Value *createMalloc(Instruction *InsertBefore, BasicBlock *InsertAtEnd,
|
||||||
MCall->setTailCall();
|
MCall->setTailCall();
|
||||||
|
|
||||||
// Create a cast instruction to convert to the right type...
|
// Create a cast instruction to convert to the right type...
|
||||||
const Type* VoidT = Type::getVoidTy(BB->getContext());
|
assert(MCall->getType() != Type::getVoidTy(BB->getContext()) &&
|
||||||
assert(MCall->getType() != VoidT && "Malloc has void return type");
|
"Malloc has void return type");
|
||||||
Value *MCast;
|
Value *MCast;
|
||||||
if (InsertBefore)
|
if (InsertBefore)
|
||||||
MCast = new BitCastInst(MCall, AllocPtrType, NameStr, InsertBefore);
|
MCast = new BitCastInst(MCall, AllocPtrType, NameStr, InsertBefore);
|
||||||
|
|
Loading…
Reference in New Issue