The current implementation output the LLVM formatted heading for group
sections, which was not valid JSON. This patch provides two small
customization points that allow the heading to vary between the two
implementations, and another that allows the section members to be
output as valid JSON objects.
Details
- Reviewers
jhenderson - Commits
- rG14f292d00e26: [llvm-readobj] Output valid JSON for GroupSections
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Please provide before and after examples, and test cases for the fix. Also, please fix the title to use "llvm-readobj" in the commit message/patch description, not simply "readobj".
Rebase
- avoid duplication in original patch
- add tests to check the JSON and LLVM differences
Looks essentially good. Just a few nits and my ongoing comment about testing.
llvm/test/tools/llvm-readobj/ELF/llvm-vs-json-format.test | ||
---|---|---|
414 ↗ | (On Diff #500342) | As in the other cases, I think you're better off moving this test case into the standard test case for printing group sections. |
llvm/tools/llvm-readobj/ELFDumper.cpp | ||
722–725 | I would consider reordering the order these methods are in. Specifically, getGroupSectionHeaderName is used before the others, so it should be first, and printEmptyGroupMessage is used last, so it should be last in order. Also applies to the definition order and other places where the function overrides are declared. | |
752–753 |
LGTM, with nit.
llvm/tools/llvm-readobj/ELFDumper.cpp | ||
---|---|---|
7777 | Nit: don't have an extra blank line at EOF (the file should end with precisely one \n). |
I would consider reordering the order these methods are in. Specifically, getGroupSectionHeaderName is used before the others, so it should be first, and printEmptyGroupMessage is used last, so it should be last in order.
Also applies to the definition order and other places where the function overrides are declared.