Index: lib/CodeGen/AsmPrinter/DwarfUnit.cpp =================================================================== --- lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -1382,14 +1382,11 @@ addUInt(DW_Subrange, dwarf::DW_AT_lower_bound, None, LowerBound); if (auto *CV = SR->getCount().dyn_cast()) { - // 'finishVariableDefinition' that creates the types for a variable is - // always called _after_ the DIEs for variables are created. - auto *CountVarDIE = getDIE(CV); - assert(CountVarDIE && "DIE for count is not yet instantiated"); - addDIEEntry(DW_Subrange, dwarf::DW_AT_count, *CountVarDIE); + if (auto *CountVarDIE = getDIE(CV)) + addDIEEntry(DW_Subrange, dwarf::DW_AT_count, *CountVarDIE); + else + ; // Should this case be handled? } else if (Count != -1) - // FIXME: An unbounded array should reference the expression that defines - // the array. addUInt(DW_Subrange, dwarf::DW_AT_count, None, Count); }