[all-commits] [llvm/llvm-project] 13a633: [gcov] Delete CC1 option -coverage-no-function-nam...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun May 10 12:52:33 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 13a633b438b6500ecad9e4f936ebadf3411d0f44
      https://github.com/llvm/llvm-project/commit/13a633b438b6500ecad9e4f936ebadf3411d0f44
  Author: Fangrui Song <maskray at google.com>
  Date:   2020-05-10 (Sun, 10 May 2020)

  Changed paths:
    M clang/include/clang/Basic/CodeGenOptions.def
    M clang/include/clang/Driver/CC1Options.td
    M clang/lib/CodeGen/BackendUtil.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    M clang/test/CodeGen/code-coverage.c
    M compiler-rt/lib/profile/GCDAProfiling.c
    M llvm/include/llvm/Transforms/Instrumentation.h
    M llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
    M llvm/test/Transforms/GCOVProfiling/function-numbering.ll

  Log Message:
  -----------
  [gcov] Delete CC1 option -coverage-no-function-names-in-data

rL144865 incorrectly wrote function names for GCOV_TAG_FUNCTION
(this might be part of the reasons the header says
"We emit files in a corrupt version of GCOV's "gcda" file format").

rL176173 and rL177475 realized the problem and introduced -coverage-no-function-names-in-data
to work around the issue. (However, the description is wrong.
libgcov never writes function names, even before GCC 4.2).

In reality, the linker command line has to look like:

clang --coverage -Xclang -coverage-version='407*' -Xclang -coverage-cfg-checksum -Xclang -coverage-no-function-names-in-data

Failing to pass -coverage-no-function-names-in-data can make gcov 4.7~7
either produce wrong results (for one gcov-4.9 program, I see "No executable lines")
or segfault (gcov-7).
(gcov-8 uses an incompatible format.)

This patch deletes -coverage-no-function-names-in-data and the related
function names support from libclang_rt.profile




More information about the All-commits mailing list