MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / try_remove_srclocs

Function try_remove_srclocs

cranelift/src/bugpoint.rs:799–805  ·  view source on GitHub ↗

Remove sourcelocs if the function still crashes after they are removed, to make the reduced clif IR easier to read.

(context: &mut CrashCheckContext, func: &mut Function)

Source from the content-addressed store, hash-verified

797
798/// Remove sourcelocs if the function still crashes after they are removed, to make the reduced clif IR easier to read.
799fn try_remove_srclocs(context: &mut CrashCheckContext, func: &mut Function) {
800 let mut func_with_removed_sourcelocs = func.clone();
801 func_with_removed_sourcelocs.srclocs.clear();
802 if let CheckResult::Crash(_) = context.check_for_crash(&func_with_removed_sourcelocs) {
803 *func = func_with_removed_sourcelocs;
804 }
805}
806
807fn reduce(isa: &dyn TargetIsa, mut func: Function, verbose: bool) -> Result<(Function, String)> {
808 let mut context = CrashCheckContext::new(isa);

Callers 1

reduceFunction · 0.85

Calls 3

check_for_crashMethod · 0.80
cloneMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected