summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-01-05 01:23:29 +0000
committerAnders Carlsson <andersca@mac.com>2009-01-05 01:23:29 +0000
commitd8cd7b6c3431a8dcbf13457730cf10a7ed4118a4 (patch)
treef644a5cd3d89279408a5b49d86f0083414e1c7e2 /clang/lib/CodeGen/CGDebugInfo.cpp
parent6fead6e33b9d6ea583270e345a18bff1a638cf74 (diff)
downloadbcm5719-llvm-d8cd7b6c3431a8dcbf13457730cf10a7ed4118a4.tar.gz
bcm5719-llvm-d8cd7b6c3431a8dcbf13457730cf10a7ed4118a4.zip
Generate debug info for VLA types
llvm-svn: 61661
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index d6a1c6b8b30..6176b868ea8 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -329,9 +329,20 @@ llvm::DIType CGDebugInfo::CreateType(const TagType *Ty,
llvm::DIType CGDebugInfo::CreateType(const ArrayType *Ty,
llvm::DICompileUnit Unit) {
- // Size and align of the whole array, not the element type.
- uint64_t Size = M->getContext().getTypeSize(Ty);
- uint64_t Align = M->getContext().getTypeAlign(Ty);
+ uint64_t Size;
+ uint64_t Align;
+
+
+ if (const VariableArrayType *VAT = dyn_cast<VariableArrayType>(Ty)) {
+
+ Size = 0;
+ Align =
+ M->getContext().getTypeSize(M->getContext().getBaseElementType(VAT));
+ } else {
+ // Size and align of the whole array, not the element type.
+ Size = M->getContext().getTypeSize(Ty);
+ Align = M->getContext().getTypeAlign(Ty);
+ }
// Add the dimensions of the array. FIXME: This loses CV qualifiers from
// interior arrays, do we care? Why aren't nested arrays represented the
OpenPOWER on IntegriCloud