This was previously attempted in 2016 by colinl's D18770, but LLD tests
were missed, which caused the change to be reverted.
Setting --print-imm-hex by default brings llvm-objdump's behavior closer
in line with objdump, and it makes it easier to read addresses and
alignment from the disassembly. It may make non-address immediates
harder to interpret, but it still seems the better default, barring more
context-sensitive base selection logic.
Differential Revision: https://reviews.llvm.org/D136972
.. option:: --no-print-imm-hex
- Do not use hex format for immediate values in disassembly output (default).
+ Do not use hex format for immediate values in disassembly output.
.. option:: --no-show-raw-insn
.. option:: --print-imm-hex
- Use hex format when printing immediate values in disassembly output.
+ Use hex format when printing immediate values in disassembly output (default).
.. option:: -S, --source
that consume ``llvm-readobj``'s JSON output should update their parsers
accordingly.
+* ``llvm-objdump`` now uses ``--print-imm-hex`` by default, which brings its
+ default behavior closer in line with ``objdump``.
+
Changes to LLDB
---------------------------------
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t\r
\r
-# RUN: llvm-objdump -d %t | FileCheck %s --check-prefix=NOPRINT\r
+# RUN: llvm-objdump -d %t | FileCheck %s --check-prefix=PRINT\r
# RUN: llvm-objdump -d --print-imm-hex --no-print-imm-hex %t | FileCheck %s --check-prefix=NOPRINT\r
# RUN: llvm-objdump -d --no-print-imm-hex --print-imm-hex %t | FileCheck %s --check-prefix=PRINT\r
\r
RawClangAST = InputArgs.hasArg(OBJDUMP_raw_clang_ast);
Relocations = InputArgs.hasArg(OBJDUMP_reloc);
PrintImmHex =
- InputArgs.hasFlag(OBJDUMP_print_imm_hex, OBJDUMP_no_print_imm_hex, false);
+ InputArgs.hasFlag(OBJDUMP_print_imm_hex, OBJDUMP_no_print_imm_hex, true);
PrivateHeaders = InputArgs.hasArg(OBJDUMP_private_headers);
FilterSections = InputArgs.getAllArgValues(OBJDUMP_section_EQ);
SectionHeaders = InputArgs.hasArg(OBJDUMP_section_headers);