]> granicus.if.org Git - clang/commit
Add a flag to remap manglings when reading profile data information.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 10 Oct 2018 23:13:35 +0000 (23:13 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 10 Oct 2018 23:13:35 +0000 (23:13 +0000)
commit58ae9852115b9cf05c3166cba9f4cffcfaa061e2
tree5949de0c96f7bb51d9d61af3a6e9122a4265b0a3
parentb6756678e3559c1304735550e28479a6289c4e52
Add a flag to remap manglings when reading profile data information.

This can be used to preserve profiling information across codebase
changes that have widespread impact on mangled names, but across which
most profiling data should still be usable. For example, when switching
from libstdc++ to libc++, or from the old libstdc++ ABI to the new ABI,
or even from a 32-bit to a 64-bit build.

The user can provide a remapping file specifying parts of mangled names
that should be treated as equivalent (eg, std::__1 should be treated as
equivalent to std::__cxx11), and profile data will be treated as
applying to a particular function if its name is equivalent to the name
of a function in the profile data under the provided equivalences. See
the documentation change for a description of how this is configured.

Remapping is supported for both sample-based profiling and instruction
profiling. We do not support remapping indirect branch target
information, but all other profile data should be remapped
appropriately.

Support is only added for the new pass manager. If someone wants to also
add support for this for the old pass manager, doing so should be
straightforward.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344199 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
docs/ReleaseNotes.rst
docs/UsersManual.rst
include/clang/Driver/Options.td
include/clang/Frontend/CodeGenOptions.h
lib/CodeGen/BackendUtil.cpp
lib/CodeGen/CodeGenModule.cpp
lib/Driver/ToolChains/Clang.cpp
lib/Frontend/CompilerInvocation.cpp
test/CodeGenCXX/Inputs/profile-remap.map [new file with mode: 0644]
test/CodeGenCXX/Inputs/profile-remap.proftext [new file with mode: 0644]
test/CodeGenCXX/Inputs/profile-remap.samples [new file with mode: 0644]
test/CodeGenCXX/profile-remap.cpp [new file with mode: 0644]
test/Driver/clang_f_opts.c