[PATCH] D30357: [ObjectYAML] Add ability for DWARFYAML to calculate DIE lengths

Chris Bieneman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 15:18:43 PST 2017


beanz created this revision.
Herald added subscribers: aprantl, jgosnell, fhahn, mgorny.

This patch adds the ability for the ObjectYAML DWARFEmitter to calculate the lengths of DIEs. This is accomplished by refactoring the code that emits the DWARF byte streams into a Visitor that traverses the DWARF YAML in-memory structure.

There are two implementations of the visitor in the DWARFEmitter, the first one (named DumpVisitor), traverses and dumps the binary DIE to a stream. The second implementation (named DIEFixupVisitor), calculates the length of the DIEs, and fixes up the Compile Unit header.

The DIEFixupVisitor can be extended in the future to enable more complex fix ups which will enable simplified YAML string representations.


https://reviews.llvm.org/D30357

Files:
  include/llvm/ObjectYAML/DWARFEmitter.h
  lib/ObjectYAML/CMakeLists.txt
  lib/ObjectYAML/DWARFEmitter.cpp
  lib/ObjectYAML/DWARFVisitor.cpp
  lib/ObjectYAML/DWARFVisitor.h
  unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30357.89732.patch
Type: text/x-patch
Size: 21357 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170224/88b0d7b9/attachment-0001.bin>


More information about the llvm-commits mailing list