This change adds JSON output to llvm-readelf. It is enabled through the --elf-output-style
option which now supports JSON in addition to the existing LLVM and GNU. This patch
just lays out the needed infrastructure and skeleton code but doesn't include any
implementation.
The major change was the need for a json printer that can be instantiated at the top level
of llvm-readobj. Since llvm-readobj uses ScopedPrinter this change adds a JSONScopedPrinter
as well as a ScopedPrinterBase which both ScopedPrinter and JSONScopedPrinter both
inherit from.
Corresponding RFC: https://lists.llvm.org/pipermail/llvm-dev/2021-September/152994.html
I'd be inclined to remove the "not all options are..." bit, as that's already the case for GNU versus LLVM style, and it will avoid the comment rotting as functionality is added.