MCPcopy Create free account
hub / github.com/Rust-for-Linux/klint / after_analysis

Method after_analysis

src/driver.rs:103–117  ·  view source on GitHub ↗
(&mut self, compiler: &Compiler, tcx: TyCtxt<'tcx>)

Source from the content-addressed store, hash-verified

101 }
102
103 fn after_analysis<'tcx>(&mut self, compiler: &Compiler, tcx: TyCtxt<'tcx>) -> Compilation {
104 let ret = self.callback.lock().unwrap().after_analysis(compiler, tcx);
105
106 if tcx.sess.opts.unstable_opts.no_codegen || !tcx.sess.opts.output_types.should_codegen() {
107 // Normally we destory `cx` in `codegen_crate`. However when codegen is not happening,
108 // that will not be invoked, and this is our last change to do cleanups.
109 let tcx_addr = *tcx as *const _ as usize;
110 let cx = TCX_EXT_MAP.lock().unwrap().remove(&tcx_addr).unwrap();
111 assert!(cx.is::<C::ExtCtxt<'static>>());
112 // SAFETY: we just check the (type-erased) type matches.
113 drop(unsafe { Box::from_raw(Box::into_raw(cx) as *mut C::ExtCtxt<'tcx>) });
114 }
115
116 ret
117 }
118}
119
120pub struct BackendWrapper<C> {

Callers

nothing calls this directly

Calls 2

unwrapMethod · 0.80
lockMethod · 0.45

Tested by

no test coverage detected