fn add_unused_functions(cx: &CodegenCx<'_, '_>)
Expand description

Each CGU will normally only emit coverage metadata for the functions that it actually generates. But since we don’t want unused functions to disappear from coverage reports, we also scan for functions that were instrumented but are not participating in codegen.

These unused functions don’t need to be codegenned, but we do need to add them to the function coverage map (in a single designated CGU) so that we still emit coverage mappings for them. We also end up adding their symbol names to a special global array that LLVM will include in its embedded coverage data.