[all-commits] [llvm/llvm-project] 1f35d7: [llvm-readobj] Add JSONScopedPrinter to llvm-readelf

Jayson Yan via All-commits all-commits at lists.llvm.org
Fri Dec 10 15:35:23 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1f35d7b5de62d17c1702f84b0217151bf1f31b1a
      https://github.com/llvm/llvm-project/commit/1f35d7b5de62d17c1702f84b0217151bf1f31b1a
  Author: Jayson Yan <jaysonyan at google.com>
  Date:   2021-12-10 (Fri, 10 Dec 2021)

  Changed paths:
    M llvm/docs/CommandGuide/llvm-readelf.rst
    M llvm/docs/CommandGuide/llvm-readobj.rst
    A llvm/test/tools/llvm-readobj/ELF/file-summary-json.test
    M llvm/test/tools/llvm-readobj/ELF/output-style.test
    A llvm/test/tools/llvm-readobj/ELF/pretty-print.test
    M llvm/tools/llvm-readobj/ELFDumper.cpp
    M llvm/tools/llvm-readobj/ObjDumper.cpp
    M llvm/tools/llvm-readobj/ObjDumper.h
    M llvm/tools/llvm-readobj/Opts.td
    M llvm/tools/llvm-readobj/llvm-readobj.cpp
    M llvm/tools/llvm-readobj/llvm-readobj.h

  Log Message:
  -----------
  [llvm-readobj] Add JSONScopedPrinter to llvm-readelf

Adds JSONScopedPrinter to llvm-readelf. It includes an empty
JSONELFDumper class which will be used to override any LLVMELFDumper
methods which utilize startLine() which JSONScopedPrinter cannot
provide.

This introduces a change where calls to llvm-readelf with non-ELF object
files that specify --elf-output-style=GNU will now print file summary
information where it previously didn't.

Fixes previous Windows test failure which occured due to JSON escaping
of '\' by not relying on LIT substitution.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D114225




More information about the All-commits mailing list