summaryrefslogtreecommitdiff
path: root/lib/VMCore/AsmWriter.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-07-31 18:23:24 +0000
committerDan Gohman <gohman@apple.com>2009-07-31 18:23:24 +0000
commit69bff07b4dc95fd0cc9d7580977beb08259daa17 (patch)
tree5956d992fae031ec019508d517150d0cb491eb96 /lib/VMCore/AsmWriter.cpp
parenta818c30d664cd4ba4b9ed69fb2048a6ea55ec9cd (diff)
downloadllvm-69bff07b4dc95fd0cc9d7580977beb08259daa17.tar.gz
llvm-69bff07b4dc95fd0cc9d7580977beb08259daa17.tar.bz2
llvm-69bff07b4dc95fd0cc9d7580977beb08259daa17.tar.xz
Fix printing of Alloca instructions with null operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AsmWriter.cpp')
-rw-r--r--lib/VMCore/AsmWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index 8824fd9244..8358c5d84c 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -1915,7 +1915,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
} else if (const AllocationInst *AI = dyn_cast<AllocationInst>(&I)) {
Out << ' ';
TypePrinter.print(AI->getType()->getElementType(), Out);
- if (AI->isArrayAllocation()) {
+ if (!AI->getArraySize() || AI->isArrayAllocation()) {
Out << ", ";
writeOperand(AI->getArraySize(), true);
}