diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index 11e06c9750d..efa59788aa5 100644 --- a/lib/IR/AsmWriter.cpp +++ b/lib/IR/AsmWriter.cpp @@ -1923,7 +1923,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) { } else if (const AllocaInst *AI = dyn_cast(&I)) { Out << ' '; - TypePrinter.print(AI->getType()->getElementType(), Out); + TypePrinter.print(AI->getAllocatedType(), Out); if (!AI->getArraySize() || AI->isArrayAllocation()) { Out << ", "; writeOperand(AI->getArraySize(), true);