[llvm-objdump] Add -M {att,intel} & deprecate --x86-asm-syntax={att,intel}
authorFangrui Song <i@maskray.me>
Wed, 5 May 2021 07:20:41 +0000 (00:20 -0700)
committerFangrui Song <i@maskray.me>
Wed, 5 May 2021 07:20:41 +0000 (00:20 -0700)
commite510860656bb81bd90ae3cf8bb5ef4dc8cd33c18
tree7ae5c6ad6166652f95824af76c1e4c3b87ad6d5b
parentcab3c6c6c48ed0da0f047bdc1a337d991c78ad8c
[llvm-objdump] Add -M {att,intel} & deprecate --x86-asm-syntax={att,intel}

The internal `cl::opt` option --x86-asm-syntax sets the AsmParser and AsmWriter
dialect. The option is used by llc and llvm-mc tests to set the AsmWriter dialect.

This patch adds -M {att,intel} as GNU objdump compatible aliases (PR43413).

Note: the dialect is initialized when the MCAsmInfo is constructed.
`MCInstPrinter::applyTargetSpecificCLOption` is called too late and its MCAsmInfo
reference is const, so changing the `cl::opt` in
`MCInstPrinter::applyTargetSpecificCLOption` is not an option, at least without
large amount of refactoring.

Reviewed By: hoy, jhenderson, thakis

Differential Revision: https://reviews.llvm.org/D101695
llvm/docs/CommandGuide/llvm-objdump.rst
llvm/docs/ReleaseNotes.rst
llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbololize-operands.yaml
llvm/test/tools/llvm-objdump/X86/syntax-mode.s [new file with mode: 0644]
llvm/tools/llvm-objdump/llvm-objdump.cpp