[PATCH] D44382: [DWARF] Rework debug line parsing to use llvm::Error

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 15 04:25:28 PDT 2018


jhenderson updated this revision to Diff 138524.
jhenderson added a comment.

Dropped unnecessary '&&' usage. Replaced use of "None" Severity with an Optional. Added remaining missing unit tests, fixed a number of issues in the test framework, and refactored some of the common test code to reduce code duplication. Also add paramterised test instantations for different DWARF formats.

I haven't yet attempted in this diff to look at how to make the code more idiomatic. I'll do that next, but I might put it up as an alternative review, so that we can evaluate both approaches simultaneously. One idea I had was rather than to use different Severities associated with each individual DebugLineError instance, to have different ErrorInfo classes for the different severities (e.g. have a DebugLineFatalError, DebugLineMajorError, and DebugLineMinorError). The handling code could still use a Severity enum or similar to report back, or I could just change how the handling code works, to take in a callback, similar to what was suggested. Thoughts?


Repository:
  rL LLVM

https://reviews.llvm.org/D44382

Files:
  include/llvm/CodeGen/AsmPrinter.h
  include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
  lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  lib/DebugInfo/DWARF/DWARFContext.cpp
  lib/DebugInfo/DWARF/DWARFDebugLine.cpp
  test/DebugInfo/X86/dwarfdump-bogus-LNE.s
  test/DebugInfo/X86/dwarfdump-line-dwo.s
  test/tools/llvm-dwarfdump/X86/Inputs/debug_line_malformed.s
  test/tools/llvm-dwarfdump/X86/Inputs/debug_line_reserved_length.s
  test/tools/llvm-dwarfdump/X86/debug_line_invalid.test
  tools/dsymutil/DwarfLinker.cpp
  unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
  unittests/DebugInfo/DWARF/DwarfGenerator.cpp
  unittests/DebugInfo/DWARF/DwarfGenerator.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44382.138524.patch
Type: text/x-patch
Size: 64173 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180315/e50df2b0/attachment.bin>


More information about the llvm-commits mailing list