Page MenuHomePhabricator

[llvm-readobj] Provide Hash Histogram for all ELFDumper implementations
Needs ReviewPublic

Authored by paulkirth on Oct 31 2022, 10:59 AM.

Details

Reviewers
jhenderson
Summary

Previously, the GNUELFDumper was the only implementer for Hash Histograms.
This patch moves the implementation for printHashHistogram and
printGnuHashHistogram into the ELFDumper base class, and allows each
derived class to specialize how it outputs that information.

This change also prevents the JSONELFDumper from emitting invalid JSON,
since the shared implementation in LLVMELFDumper no longer emits a
warning message to the output stream.

Diff Detail

Event Timeline

paulkirth created this revision.Oct 31 2022, 10:59 AM
Herald added a project: Restricted Project. · View Herald Transcript
paulkirth requested review of this revision.Oct 31 2022, 10:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 31 2022, 10:59 AM

I'd rather not do this, and would strongly prefer we simply do it right the first time.

paulkirth updated this revision to Diff 484081.Dec 19 2022, 2:42 PM
paulkirth retitled this revision from [readobj] Ignore hash histogram in JSON output to [llvm-readobj] Provide Hash Histogram for all ELFDumper implementations.
paulkirth edited the summary of this revision. (Show Details)

Rebase

  • Replace empty implementation with a shared impl in the ELFDumper base class and printing APIs for derived classes to specialize.
  • Add test to check the formatting for the LLVM style output
paulkirth updated this revision to Diff 484090.Dec 19 2022, 2:49 PM

Rebase to fix patch application

paulkirth updated this revision to Diff 484092.Dec 19 2022, 2:51 PM

Fix formatting