Llvm-cov not showing several headers (original) (raw)

December 7, 2025, 1:47am 1

I have a small project with a few headers, some being large. When I run llvm-cov none of the headers except for 1 is shown. I only run the binary once and I call profdata with llvm-profdata merge -sparse default.profraw -o out.profdata.

Any idea why? I compile the code using C++23 with -fprofile-instr-generate -fcoverage-mapping.

Hi – how are you invoking llvm-cov? Also, are the headers at the same path as when the project was built (assuming the same build machine)?

-Alan

It’s a test project. All the source files and headers are in the base directory. Only 1 of the 5 headers show and the header I am interested in is included in every cpp file

llvm-cov report ./mybin -instr-profile=out.profdata

I figured the problem out

Almost all my files include main.h (the one header that was shown, it’s fairly small), personal_stdlib.h and personal_stdlib_advance.h

My personal std has this line, which made it not appear. That’s all there was to it

#pragma GCC system_header