MCPcopy Index your code
hub / github.com/Rust-API/Rust-API-Bypass-Checker / get_wto

Method get_wto

src/analysis/global_context.rs:312–331  ·  view source on GitHub ↗
(&mut self, def_id: DefId)

Source from the content-addressed store, hash-verified

310 }
311
312 pub fn get_wto(&mut self, def_id: DefId) -> Wto<'tcx> {
313 let mir = self.tcx.optimized_mir(def_id);
314 let wto;
315 // First see whether the wto has been already computed
316 if let Some(cached_wto) = self.wto_cache.get(def_id) {
317 debug!("Using cached w.t.o for {}", self.tcx.item_name(def_id));
318 wto = cached_wto.clone();
319 } else {
320 // If not, compute the wto
321 wto = Wto::new(mir);
322 debug!(
323 "Compute the new w.t.o for {}: {:?}",
324 self.tcx.item_name(def_id),
325 wto
326 );
327 // Cache the wto
328 self.wto_cache.insert(def_id, wto.clone());
329 }
330 wto
331 }
332
333 /// 扫描一个函数:只做“一层”Call 捕获
334 /// - 本地 callee:加入 func.callees(浅层信息)

Callers 1

newMethod · 0.80

Calls 2

getMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected