let (mangled_fn_name, _len_val) = self.const_str(mangled_fn.name);
let hash = self.const_u64(coverage_data.hash);
let index = args[0].immediate();
- let num_counters = self.const_u32(coverage_data.num_counters as u32);
+ let num_counters = self.const_u32(coverage_data.num_counters);
debug!(
"count_code_region to LLVM intrinsic instrprof.increment(fn_name={}, hash={:?}, num_counters={:?}, index={:?})",
mangled_fn.name, hash, index, num_counters
pub hash: u64,
/// The total number of coverage region counters added to this MIR Body.
- pub num_counters: usize,
+ pub num_counters: u32,
}
/// The lowered representation of a single function.
bool,
usize,
::rustc_target::abi::VariantIdx,
+ u32,
u64,
String,
crate::middle::region::Scope,
struct Instrumentor<'tcx> {
tcx: TyCtxt<'tcx>,
- num_counters: usize,
+ num_counters: u32,
}
impl<'tcx> MirPass<'tcx> for InstrumentCoverage {
}
fn next_counter(&mut self) -> u32 {
- let next = self.num_counters as u32;
+ let next = self.num_counters;
self.num_counters += 1;
next
}
- fn inject_counters(&mut self, mir_body: &mut mir::Body<'tcx>) -> usize {
+ fn inject_counters(&mut self, mir_body: &mut mir::Body<'tcx>) -> u32 {
// FIXME(richkadel): As a first step, counters are only injected at the top of each
// function. The complete solution will inject counters at each conditional code branch.
let top_of_function = START_BLOCK;