Open vit9696 opened 2 years ago
CC @petrhosek, @keith
IIRC @petrhosek had some thoughts when we introduced -fcoverage-prefix-map
about whether or not it should apply to all profiles (originally it was named -fprofile-prefix-map
and we changed the name since it didn't end up that way). This seems like a reasonable thing to me, alternatively it could be only added to -ffile-prefix-map
if that covered most cases.
We used the name -fcoverage-prefix-map
to make it clear that it only only applies to Clang coverage mapping and not to profile instrumentation (which is shared by both coverage and PGO). Since the feature you're proposing is specific to gcov, using a separate flag that matches the name used by GCC would be preferable to me.
Marxin from GCC suggested to keep using -fprofile-prefix-map
, and there is a working patch in the bugzilla. Can we follow this in clang? I guess I can work on the patch if the design is settled.
Posted initial version of the patch on phabricator: https://reviews.llvm.org/D124767
@llvm/issue-subscribers-clang-codegen
When compiling code with
-fprofile-arcs
clang encodes full .gcda file path based on the object file path. In some cases this is infeasible, as the compilation directory may have extra long prefix, which is not practical to store on embedded targets.To avoid this issue we would like to replace this prefix with a custom value by extending
-fcoverage-prefix-map
option. There is a similar issue in gcc (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105063), where we were able to reach a certain level of agreement. Will clang follow?