summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
index ed2dfa6906f..6eba00be00e 100644
--- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -1277,11 +1277,12 @@ TypeIndex CodeViewDebug::lowerTypeArray(const DICompositeType *Ty) {
"codeview doesn't support subranges with lower bounds");
int64_t Count = Subrange->getCount();
- // Variable Length Array (VLA) has Count equal to '-1'.
- // Replace with Count '1', assume it is the minimum VLA length.
+ // Variable length arrays and forward declarations of arrays without a size
+ // use a count of -1. Emit a count (and overall size) or zero in these cases
+ // to match what MSVC does for array declarations with no count.
// FIXME: Make front-end support VLA subrange and emit LF_DIMVARLU.
if (Count == -1)
- Count = 1;
+ Count = 0;
// Update the element size and element type index for subsequent subranges.
ElementSize *= Count;
OpenPOWER on IntegriCloud