diff --git a/llvm/docs/CommandGuide/llvm-objdump.rst b/llvm/docs/CommandGuide/llvm-objdump.rst --- a/llvm/docs/CommandGuide/llvm-objdump.rst +++ b/llvm/docs/CommandGuide/llvm-objdump.rst @@ -196,7 +196,7 @@ .. 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 @@ .. 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 diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -200,6 +200,9 @@ 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 --------------------------------- diff --git a/llvm/test/tools/llvm-objdump/X86/print-imm-hex.s b/llvm/test/tools/llvm-objdump/X86/print-imm-hex.s --- a/llvm/test/tools/llvm-objdump/X86/print-imm-hex.s +++ b/llvm/test/tools/llvm-objdump/X86/print-imm-hex.s @@ -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 diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -3030,7 +3030,7 @@ 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);