[llvm-cxxfilt] Improve strip-underscore behavior
authorSteven Wu <stevenwu@apple.com>
Mon, 18 Nov 2019 22:51:41 +0000 (14:51 -0800)
committerSteven Wu <stevenwu@apple.com>
Mon, 18 Nov 2019 23:05:41 +0000 (15:05 -0800)
commite84468c1f145e9a5e54640ebdc78bc40c7da3fce
tree289e7aee48dbe9dd299a5d30227768d255a8c508
parentaeca47fa0fbc36a43bced6a482a2e61acc3162a1
[llvm-cxxfilt] Improve strip-underscore behavior

Summary:
For platform that uses macho format, c++filt should be stripping the
leading underscore by default. Introduce the binutil compatible "-n"
option to control strip-undercore behaivor together with the existing
"-_" option and fallback to system default if none of them are set.

rdar://problem/57173514

Reviewers: compnerd, erik.pilkington, dexonsmith, mattd

Reviewed By: compnerd, erik.pilkington

Subscribers: jkorous, ributzka, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70250
llvm/test/tools/llvm-cxxfilt/abitag.test
llvm/test/tools/llvm-cxxfilt/coff-import.test
llvm/test/tools/llvm-cxxfilt/darwin.test [new file with mode: 0644]
llvm/test/tools/llvm-cxxfilt/delimiters.test
llvm/test/tools/llvm-cxxfilt/empty-line.test
llvm/test/tools/llvm-cxxfilt/invalid.test
llvm/test/tools/llvm-cxxfilt/noargs.test
llvm/test/tools/llvm-cxxfilt/simple.test
llvm/test/tools/llvm-cxxfilt/types.test
llvm/test/tools/llvm-cxxfilt/underscore.test
llvm/tools/llvm-cxxfilt/llvm-cxxfilt.cpp