[PATCH] D42940: Fix a crash when emitting DIEs for variable-length arrays

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 17:23:54 PST 2018


aprantl created this revision.
aprantl added a reviewer: dblaikie.
Herald added a subscriber: JDevlieghere.

VLAs may refer to a previous DIE to express the DW_AT_count of their type. Clang generates an artificial "vla_expr" variable for this. If this DIE hasn't been created yet LLVM asserts. This patch fixes this by sorting the local variables so that dependencies come before they are needed. It also replaces the linear scan in DWARFFile with a std::map, which can be faster.


https://reviews.llvm.org/D42940

Files:
  lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
  lib/CodeGen/AsmPrinter/DwarfFile.cpp
  lib/CodeGen/AsmPrinter/DwarfFile.h
  test/DebugInfo/X86/vla-dependencies.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42940.132921.patch
Type: text/x-patch
Size: 12991 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180206/23860203/attachment.bin>


More information about the llvm-commits mailing list