[PATCH] D44562: [ELF] Rework debug line parsing to use llvm::Error and callbacks (LLD-side)

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 16 06:57:23 PDT 2018


jhenderson created this revision.
jhenderson added reviewers: ruiu, espindola.

Feedback on https://reviews.llvm.org/D44382 suggested to change the interface to use a callback instead of the structures used. As I didn't want to effectively overwrite that diff, I created https://reviews.llvm.org/D44560 as an alternative implementation using the suggested approach. This is the corresponding patch required for LLD assuming https://reviews.llvm.org/D44560 were to be applied.

As with https://reviews.llvm.org/D44382, https://reviews.llvm.org/D44560 changes the debug line parser interface to report LLVM errors, and to improve the error/warning reporting mechanism to not use fprintf(stderr, ...). These warnings were not using the errs() stream, and so were not always being flushed properly by LLD on shutdown. To test this, I have extended the bad-debug undefined symbol message case to show that a corresponding warning is printed, if the debug line cannot be parsed. In addition, I have also stopped LLD from attempting to parse a non-existent/empty debug line section, so that the new warning for attempting to do this is not emitted.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D44562

Files:
  ELF/InputFiles.cpp
  test/ELF/Inputs/undef-bad-debug.s
  test/ELF/no-line-parser-errors-if-empty-section.s
  test/ELF/no-line-parser-errors-if-no-section.s
  test/ELF/undef.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44562.138691.patch
Type: text/x-patch
Size: 4996 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180316/b9ef41e5/attachment.bin>


More information about the llvm-commits mailing list