diff options
author | Sander de Smalen <sander.desmalen@arm.com> | 2018-02-17 11:06:53 +0000 |
---|---|---|
committer | Sander de Smalen <sander.desmalen@arm.com> | 2018-02-17 11:06:53 +0000 |
commit | bf83be9e2a569e06a09b835c49def5cc3be74919 (patch) | |
tree | 348c49d75d66bfb75a4e9efe617f2044d525498f /llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | |
parent | d48042efa831f8f9bde7bf88585eb5b02565b718 (diff) | |
download | bcm5719-llvm-bf83be9e2a569e06a09b835c49def5cc3be74919.tar.gz bcm5719-llvm-bf83be9e2a569e06a09b835c49def5cc3be74919.zip |
[DebugInfo] Removed assert on missing CountVarDIE
Summary:
The assert for a DISubrange's CountVarDIE to be available fails
when the dbg.value() has been optimized away for any reason.
Having the assert for that is a little heavy, so instead removing
it now in favor of not generating the 'count' expression.
Addresses http://llvm.org/PR36263 .
Reviewers: aprantl, dblaikie, probinson
Reviewed By: aprantl
Subscribers: JDevlieghere, llvm-commits, dstenb
Differential Revision: https://reviews.llvm.org/D43387
llvm-svn: 325427
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index 4889abcf565..76e1228cafc 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -1382,14 +1382,9 @@ void DwarfUnit::constructSubrangeDIE(DIE &Buffer, const DISubrange *SR, 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 if (Count != -1) - // FIXME: An unbounded array should reference the expression that defines - // the array. addUInt(DW_Subrange, dwarf::DW_AT_count, None, Count); } |