aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index e0a52d6184..79abc34064 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -337,11 +337,14 @@ llvm::DIType CGDebugInfo::CreateType(const ArrayType *Ty,
uint64_t Align;
+ // FIXME: make getTypeAlign() aware of VLAs and incomplete array types
if (const VariableArrayType *VAT = dyn_cast<VariableArrayType>(Ty)) {
-
Size = 0;
Align =
- M->getContext().getTypeSize(M->getContext().getBaseElementType(VAT));
+ M->getContext().getTypeAlign(M->getContext().getBaseElementType(VAT));
+ } else if (Ty->isIncompleteArrayType()) {
+ Size = 0;
+ Align = M->getContext().getTypeAlign(Ty->getElementType());
} else {
// Size and align of the whole array, not the element type.
Size = M->getContext().getTypeSize(Ty);