aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-08-07 00:48:43 +0000
committerEric Christopher <echristo@apple.com>2012-08-07 00:48:43 +0000
commitc7fb74806190220ba46bc175568f5c0edd49b810 (patch)
tree5a0ae3d4231c6c425a64f6f0ee57a7eccf59dfa9 /lib/CodeGen/CGDebugInfo.cpp
parent97d029305999f940869ff8eea42902bbd193f6d0 (diff)
If we don't have a complete type for the array type yet either then
just let the alignment be zero. PR13531 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161379 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 00555674f0..379d1585a5 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -1468,7 +1468,10 @@ llvm::DIType CGDebugInfo::CreateType(const ArrayType *Ty,
CGM.getContext().getTypeAlign(CGM.getContext().getBaseElementType(VAT));
} else if (Ty->isIncompleteArrayType()) {
Size = 0;
- Align = CGM.getContext().getTypeAlign(Ty->getElementType());
+ if (Ty->getElementType()->isIncompleteType())
+ Align = 0;
+ else
+ Align = CGM.getContext().getTypeAlign(Ty->getElementType());
} else if (Ty->isDependentSizedArrayType() || Ty->isIncompleteType()) {
Size = 0;
Align = 0;