diff options
author | Fangrui Song <i@maskray.me> | 2021-05-26 10:43:32 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2021-05-26 10:43:32 -0700 |
commit | 73a117953599af58645d944e68076ec8fb052540 (patch) | |
tree | 467944707f7b993a441486f68fd4a2b5d21187a7 /llvm/tools/llvm-mc/llvm-mc.cpp | |
parent | 921d3f7af09c6a08d2d2897e6fcce6127a9f4fd4 (diff) | |
download | llvm-73a117953599af58645d944e68076ec8fb052540.zip llvm-73a117953599af58645d944e68076ec8fb052540.tar.gz llvm-73a117953599af58645d944e68076ec8fb052540.tar.bz2 |
[llvm-mc] Add -M to replace -riscv-no-aliases and -riscv-arch-reg-names
In objdump, many targets support `-M no-aliases`. Instead of having a
`-*-no-aliases` for each target when LLVM adds the support, it makes more sense
to introduce objdump style `-M`.
-riscv-arch-reg-names is removed. -riscv-no-aliases has too many uses and thus is retained for now.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D103004
Diffstat (limited to 'llvm/tools/llvm-mc/llvm-mc.cpp')
-rw-r--r-- | llvm/tools/llvm-mc/llvm-mc.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/tools/llvm-mc/llvm-mc.cpp b/llvm/tools/llvm-mc/llvm-mc.cpp index 73a3a05..71940a7 100644 --- a/llvm/tools/llvm-mc/llvm-mc.cpp +++ b/llvm/tools/llvm-mc/llvm-mc.cpp @@ -46,6 +46,9 @@ static mc::RegisterMCTargetOptionsFlags MOF; static cl::opt<std::string> InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-")); +static cl::list<std::string> + DisassemblerOptions("M", cl::desc("Disassembler options")); + static cl::opt<std::string> OutputFilename("o", cl::desc("Output filename"), cl::value_desc("filename"), cl::init("-")); @@ -496,6 +499,12 @@ int main(int argc, char **argv) { return 1; } + for (StringRef Opt : DisassemblerOptions) + if (!IP->applyTargetSpecificCLOption(Opt)) { + WithColor::error() << "invalid disassembler option '" << Opt << "'\n"; + return 1; + } + // Set the display preference for hex vs. decimal immediates. IP->setPrintImmHex(PrintImmHex); |