[PATCH] D101695: [llvm-objdump] Add -M {att,intel} as user-facing alternatives to --x86-asm-syntax={att,intel}

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 3 13:45:03 PDT 2021


MaskRay marked 4 inline comments as done.
MaskRay added inline comments.


================
Comment at: llvm/docs/CommandGuide/llvm-objdump.rst:153
+  * ``reg-names-raw``: ARM only. Use r followed by the register number.
+  * ``no-aliases``: RISC-V only. Print raw instruction mnemonic instead of pesudo instruction mnemonic.
+  * ``numeric``: RISC-V only. Print raw register names instead of ABI mnemonic. (e.g. print x1 instead of ra)
----------------
hoy wrote:
> Do these RISC-V switches just work? Wondering if testing is needed.
It just works (D66139), but ideally there should be `test/tools/llvm-objdump` specific tests.


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:2480
+  llvm::erase_if(DisassemblerOptions, [&](StringRef V) {
+    if (V == "att") {
+      LLVMArgs.push_back("--x86-asm-syntax=att");
----------------
hoy wrote:
> thakis wrote:
> > equals_lower() for better objdump compat?
> Can this be made an alias switch of `OBJDUMP_x86_asm_syntax_att`?
I think GNU objdump uses startswith for case-sensitive "intel" and "att" and ignores unrecognized values.

I don't think anyone wants to use "intel*" (other than the unimplemented "intel-mnenomic" so I'll just use rigid `==` here.


================
Comment at: llvm/tools/llvm-objdump/llvm-objdump.cpp:2480
+  llvm::erase_if(DisassemblerOptions, [&](StringRef V) {
+    if (V == "att") {
+      LLVMArgs.push_back("--x86-asm-syntax=att");
----------------
MaskRay wrote:
> hoy wrote:
> > thakis wrote:
> > > equals_lower() for better objdump compat?
> > Can this be made an alias switch of `OBJDUMP_x86_asm_syntax_att`?
> I think GNU objdump uses startswith for case-sensitive "intel" and "att" and ignores unrecognized values.
> 
> I don't think anyone wants to use "intel*" (other than the unimplemented "intel-mnenomic" so I'll just use rigid `==` here.
> Can this be made an alias switch of OBJDUMP_x86_asm_syntax_att?

No. `llvm-objdump --x86-asm-syntax` will retire.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101695/new/

https://reviews.llvm.org/D101695



More information about the llvm-commits mailing list