[llvm-dev] [RFC] Add machine readable output to LLVM tools

Jayson Yan via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 29 11:25:20 PDT 2021


Hi all,

We are interested in adding the ability to produce machine readable output
to some of the tools that LLVM provides. The goal is to provide easier
automation capabilities for future scripting. We wanted to gauge interest
as well as discuss how the community would like this to be implemented.

Currently the plan is to surface this as an optional flag which if set will
have the tool output machine readable output. We are planning for the
output format to be in JSON, if anyone feels strongly about another format
please let us know. The tools we initially hope to tackle are llvm-nm and
llvm-readelf but we’d be interested to hear if there are tools that the
community feels would benefit from this.

The high level implementation plan is to provide an abstract interface for
output with human-readable output as one concrete implementation of this
interface and a new machine-readable output as another implementation. For
tools like llvm-readelf, this infrastructure already exists so it would
just be a matter of implementing a JSONELFDumper on top of the existing
GNUELFDumper and LLVMELFDumper. For tools like llvm-nm this infrastructure
doesn’t exist so we’d need to add this abstraction first.

Interested to hear any thoughts on:

- How would we like to surface this feature?

- Which tools would be most valuable to provide machine-readable output?

- Does the implementation plan make sense?

Thanks

- Jayson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210929/1f6745fe/attachment.html>


More information about the llvm-dev mailing list