Don't use $ as suffix for symbol names in ThinLTOBitcodeWriter and other places
authorHans Wennborg <hans@chromium.org>
Thu, 25 Feb 2021 15:51:31 +0000 (16:51 +0100)
committerHans Wennborg <hans@chromium.org>
Mon, 29 Mar 2021 11:03:52 +0000 (13:03 +0200)
commitc6e5c4654bd5045fe22a1a52779e48e2038a404c
treec07809b1a21b49f6a382b5d9635f4ad91cbf7911
parent883912abe669ef246ada0adc9cf1c9748b742400
Don't use $ as suffix for symbol names in ThinLTOBitcodeWriter and other places

Using $ breaks demangling of the symbols. For example,

$ c++filt _Z3foov\$123
_Z3foov$123

This causes problems for developers who would like to see nice stack traces
etc., but also for automatic crash tracking systems which try to organize
crashes based on the stack traces.

Instead, use the period as suffix separator, since Itanium demanglers normally
ignore such suffixes:

$ c++filt _Z3foov.123
foo() [clone .123]

This is already done in some places; try to do it everywhere.

Differential revision: https://reviews.llvm.org/D97484
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
llvm/lib/Transforms/Utils/ModuleUtils.cpp
llvm/test/Instrumentation/AddressSanitizer/global_with_comdat.ll
llvm/test/ThinLTO/X86/devirt.ll
llvm/test/ThinLTO/X86/devirt2.ll
llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal-typeid.ll
llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal1.ll
llvm/test/Transforms/ThinLTOBitcodeWriter/split-internal2.ll
llvm/test/Transforms/ThinLTOBitcodeWriter/split-vfunc-internal.ll
llvm/test/Transforms/WholeProgramDevirt/export-single-impl.ll
llvm/tools/llvm-lto2/llvm-lto2.cpp