MCPcopy Create free account
hub / github.com/Rust-API/Rust-API-Bypass-Checker / run_analysis

Method run_analysis

src/analysis/callback.rs:49–92  ·  view source on GitHub ↗
(
        &mut self,
        compiler: &'compiler interface::Compiler,
        tcx: TyCtxt<'tcx>,
    )

Source from the content-addressed store, hash-verified

47
48impl BypasserCallbacks {
49 fn run_analysis<'tcx, 'compiler>(
50 &mut self,
51 compiler: &'compiler interface::Compiler,
52 tcx: TyCtxt<'tcx>,
53 ) {
54 if self.source_name.contains("/libcore")
55 || self.source_name.contains("/compiler_builtins")
56 || self.source_name.contains("/liballoc")
57 || self.source_name.contains("/macro")
58 || self.source_name.contains("/libc")
59 {
60 info!(
61 "Find filename that should skip the analysis: {}",
62 self.source_name
63 );
64 return;
65 }
66
67 // Initialize global analysis context
68 if let Some(mut global_context) =
69 GlobalContext::new(&compiler.sess, tcx, self.analysis_options.clone())
70 {
71 // Initialize numerical analyzer
72 let mut numerical_analysis = NumericalAnalysis::new(&mut global_context);
73 // Run analyzer
74 if let Ok(analysis_result) = numerical_analysis.run() {
75 info!(
76 "Numerical Analysis Completed: {} ms, diagnostics={}, supported_diagnostics={}, unsupported_diagnostics={}, call_boundary_diagnostics={}, supported_special_calls={}, unsupported_special_calls={}, opaque_call_boundaries={}",
77 analysis_result.analysis_time.as_millis(),
78 analysis_result.total_diagnostics,
79 analysis_result.supported_diagnostics,
80 analysis_result.unsupported_diagnostics,
81 analysis_result.call_boundary_diagnostics,
82 analysis_result.supported_special_calls,
83 analysis_result.unsupported_special_calls,
84 analysis_result.opaque_call_boundaries,
85 );
86 } else {
87 error!("Numerical Analysis Failed");
88 }
89 } else {
90 error!("GlobalContext Initialization Failed");
91 }
92 }
93}

Callers 1

after_analysisMethod · 0.45

Calls 2

containsMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected