[LLVMdev] Making llvm-objdump more like GNU objdump

Steve King steve at metrokings.com
Thu Dec 4 10:09:03 PST 2014


On Wed, Dec 3, 2014 at 5:09 PM, Kevin Enderby <enderby at apple.com> wrote:
> Seem like a good place to start if you want to create a patch
> that honors the --print-imm-hex option for ELF files.

Let's skip that.  Piecemeal format controls like --print-imm-hex are
too problematic since they pile up quickly and require nitpick checks
in the target's InstPrinter code.  I see you've already got at least
three on your command line:

-no-show-raw-insn -full-leading-addr -print-imm-hex ...

Since each target controls it's own operand format, each target
decides how closely to conform to whatever style matters most to them.
This will involve more fine grain formatting issues than we'll want to
control on the command line.

In keeping with the main idea bouncing around, how about a global
style enum with "GNU", "OTOOL", etc. available in MCInstPrinter()?
llvm-objdump can set the global style automatically based on the
binary's container.  The user can override the default on the command
line.  Targets can check the hint and then do that they know to be
best.

Regards,
-steve



More information about the llvm-dev mailing list