[llvm-objdump] Set --print-imm-hex by default.
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
This commit is contained in:
@@ -196,7 +196,7 @@ OPTIONS
|
||||
|
||||
.. 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
|
||||
|
||||
@@ -219,7 +219,7 @@ OPTIONS
|
||||
|
||||
.. 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
|
||||
|
||||
|
||||
@@ -200,6 +200,9 @@ Changes to the LLVM tools
|
||||
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
|
||||
---------------------------------
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t
|
||||
|
||||
# RUN: llvm-objdump -d %t | FileCheck %s --check-prefix=NOPRINT
|
||||
# RUN: llvm-objdump -d %t | FileCheck %s --check-prefix=PRINT
|
||||
# RUN: llvm-objdump -d --print-imm-hex --no-print-imm-hex %t | FileCheck %s --check-prefix=NOPRINT
|
||||
# RUN: llvm-objdump -d --no-print-imm-hex --print-imm-hex %t | FileCheck %s --check-prefix=PRINT
|
||||
|
||||
|
||||
@@ -3030,7 +3030,7 @@ static void parseObjdumpOptions(const llvm::opt::InputArgList &InputArgs) {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user