pub trait CoverageInfoMethods<'tcx>: BackendTypes {
fn coverageinfo_finalize(&self);
fn define_unused_fn(&self, def_id: DefId);
fn get_pgo_func_name_var(&self, instance: Instance<'tcx>) -> Self::Value;
}
Required Methods
source
fn coverageinfo_finalize(&self)
sourcefn define_unused_fn(&self, def_id: DefId)
fn define_unused_fn(&self, def_id: DefId)
Codegen a small function that will never be called, with one counter
that will never be incremented, that gives LLVM coverage tools a
function definition it needs in order to resolve coverage map references
to unused functions. This is necessary so unused functions will appear
as uncovered (coverage execution count 0
) in LLVM coverage reports.
sourcefn get_pgo_func_name_var(&self, instance: Instance<'tcx>) -> Self::Value
fn get_pgo_func_name_var(&self, instance: Instance<'tcx>) -> Self::Value
For LLVM codegen, returns a function-specific Value
for a global
string, to hold the function name passed to LLVM intrinsic
instrprof.increment()
. The Value
is only created once per instance.
Multiple invocations with the same instance return the same Value
.