Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-objdump] Add -M {att,intel} & deprecate --x86-asm-syntax={att,i…
…ntel} 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
- Loading branch information
Showing
5 changed files
with
69 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbololize-operands.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Test att and intel syntax modes. | ||
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t | ||
# RUN: llvm-objdump -d %t | FileCheck %s --check-prefix=ATT | ||
# RUN: llvm-objdump -d -M att %t | FileCheck %s --check-prefix=ATT | ||
# RUN: llvm-objdump -dMintel %t | FileCheck %s --check-prefix=INTEL | ||
# RUN: llvm-objdump -d --disassembler-options=intel %t | FileCheck %s --check-prefix=INTEL | ||
|
||
## The last wins. | ||
# RUN: llvm-objdump -dM att -M att,intel %t | FileCheck %s --check-prefix=INTEL | ||
|
||
## Test discouraged internal cl::opt options. | ||
# RUN: llvm-objdump -d --x86-asm-syntax=att %t | FileCheck %s --check-prefix=ATT | ||
# RUN: llvm-objdump -d --x86-asm-syntax=intel %t | FileCheck %s --check-prefix=INTEL | ||
|
||
# ATT: movw $1, %ax | ||
# ATT: imull %esi, %edi | ||
# ATT: leaq 5(%rsi,%rdi,4), %rax | ||
|
||
# INTEL: mov ax, 1 | ||
# INTEL: imul edi, esi | ||
# INTEL: lea rax, [rsi + 4*rdi + 5] | ||
|
||
movw $1, %ax | ||
imull %esi, %edi | ||
leaq 5(%rsi,%rdi,4), %rax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters