[PATCH] D43387: [DebugInfo] Removed assert on missing CountVarDIE
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 16 09:24:59 PST 2018
sdesmalen updated this revision to Diff 134645.
https://reviews.llvm.org/D43387
Files:
lib/CodeGen/AsmPrinter/DwarfUnit.cpp
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<DIVariable*>()) {
- // '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);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43387.134645.patch
Type: text/x-patch
Size: 1013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180216/0d6d5e3c/attachment.bin>
More information about the llvm-commits
mailing list