Author: David Spickett Date: 2020-11-30T12:52:54Z New Revision: c2ead57ccf74900901fdda1cd0fbe9a7a0d1297a
URL: https://github.com/llvm/llvm-project/commit/c2ead57ccf74900901fdda1cd0fbe9a7a0d1297a DIFF: https://github.com/llvm/llvm-project/commit/c2ead57ccf74900901fdda1cd0fbe9a7a0d1297a.diff LOG: [llvm-objdump] Document --mattr=help in --help output This does the same as `--mcpu=help` but was only documented in the user guide. * Added a test for both options. * Corrected the single dash in `-mcpu=help` text. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D92305 Added: llvm/test/tools/llvm-objdump/mattr-mcpu-help.test Modified: llvm/docs/CommandGuide/llvm-objdump.rst llvm/tools/llvm-objdump/llvm-objdump.cpp Removed: ################################################################################ diff --git a/llvm/docs/CommandGuide/llvm-objdump.rst b/llvm/docs/CommandGuide/llvm-objdump.rst index 4acb04833ab13..1ac7a05cbdb0a 100644 --- a/llvm/docs/CommandGuide/llvm-objdump.rst +++ b/llvm/docs/CommandGuide/llvm-objdump.rst @@ -156,7 +156,7 @@ OPTIONS .. option:: --mattr=<a1,+a2,-a3,...> - Enable/disable target-specific attributes. Specify ``--mcpu=help`` to display + Enable/disable target-specific attributes. Specify ``--mattr=help`` to display the available attributes. .. option:: --no-leading-addr diff --git a/llvm/test/tools/llvm-objdump/mattr-mcpu-help.test b/llvm/test/tools/llvm-objdump/mattr-mcpu-help.test new file mode 100644 index 0000000000000..4c3198b0fbfed --- /dev/null +++ b/llvm/test/tools/llvm-objdump/mattr-mcpu-help.test @@ -0,0 +1,15 @@ +# RUN: yaml2obj %s -o %t +# RUN: llvm-objdump -d %t --mattr=help 2>&1 | FileCheck %s +# RUN: llvm-objdump -d %t --mcpu=help 2>&1 | FileCheck %s + +# CHECK: Available CPUs for this target: +# CHECK: Available features for this target: +## To check we still disassemble the file: +# CHECK: file format elf64-x86-64 + +--- !ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_EXEC + Machine: EM_X86_64 diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index bc13b26b797d8..bb33d254370e6 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -226,13 +226,13 @@ static cl::alias MachOm("m", cl::desc("Alias for --macho"), cl::NotHidden, cl::Grouping, cl::aliasopt(MachOOpt)); cl::opt<std::string> objdump::MCPU( - "mcpu", cl::desc("Target a specific cpu type (-mcpu=help for details)"), + "mcpu", cl::desc("Target a specific cpu type (--mcpu=help for details)"), cl::value_desc("cpu-name"), cl::init(""), cl::cat(ObjdumpCat)); -cl::list<std::string> objdump::MAttrs("mattr", cl::CommaSeparated, - cl::desc("Target specific attributes"), - cl::value_desc("a1,+a2,-a3,..."), - cl::cat(ObjdumpCat)); +cl::list<std::string> objdump::MAttrs( + "mattr", cl::CommaSeparated, + cl::desc("Target specific attributes (--mattr=help for details)"), + cl::value_desc("a1,+a2,-a3,..."), cl::cat(ObjdumpCat)); cl::opt<bool> objdump::NoShowRawInsn( "no-show-raw-insn", _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits