[llvm-objdump] Implement --prefix-strip option
authorVinicius Tinti <viniciustinti@gmail.com>
Sat, 1 Aug 2020 01:45:05 +0000 (22:45 -0300)
committerVinicius Tinti <viniciustinti@gmail.com>
Wed, 24 Mar 2021 13:22:35 +0000 (13:22 +0000)
commit804ff7f2933f2b0845da12c84c439a2e3d8b4e69
tree20f46c45ab6536caac8ff4928f9290f53345cdd1
parentcfc36bf0179435ecbd489761bd7d5dae00846c87
[llvm-objdump] Implement --prefix-strip option

The option `--prefix-strip` is only used when `--prefix` is not empty.
It removes N initial directories from absolute paths before adding the
prefix.

This matches GNU's objdump behavior.

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D96679
llvm/docs/CommandGuide/llvm-objdump.rst
llvm/docs/llvm-objdump.1
llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test
llvm/tools/llvm-objdump/llvm-objdump.cpp
llvm/tools/llvm-objdump/llvm-objdump.h