From 1500742a226277ec260cdf34c87e04b60845ec29 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 26 Oct 2020 20:01:18 -0700 Subject: [PATCH] Remove `source_loc` from `TrapInformation` Turns out this wasn't needed anywhere! Additionally we can construct it from `InstructionAddressMap` anyway. There's so many pieces of trap information that it's best to keep these structures small as well. --- crates/cranelift/src/lib.rs | 3 +-- crates/environ/src/compilation.rs | 2 -- crates/lightbeam/wasmtime/src/lib.rs | 3 +-- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/cranelift/src/lib.rs b/crates/cranelift/src/lib.rs index 58d7d225006c..8d8df744cfbb 100644 --- a/crates/cranelift/src/lib.rs +++ b/crates/cranelift/src/lib.rs @@ -195,12 +195,11 @@ impl binemit::TrapSink for TrapSink { fn trap( &mut self, code_offset: binemit::CodeOffset, - source_loc: ir::SourceLoc, + _source_loc: ir::SourceLoc, trap_code: ir::TrapCode, ) { self.traps.push(TrapInformation { code_offset, - source_loc, trap_code, }); } diff --git a/crates/environ/src/compilation.rs b/crates/environ/src/compilation.rs index eb97e360708b..c3ecd2e451a4 100644 --- a/crates/environ/src/compilation.rs +++ b/crates/environ/src/compilation.rs @@ -61,8 +61,6 @@ pub enum RelocationTarget { pub struct TrapInformation { /// The offset of the trapping instruction in native code. It is relative to the beginning of the function. pub code_offset: binemit::CodeOffset, - /// Location of trapping instruction in WebAssembly binary module. - pub source_loc: ir::SourceLoc, /// Code of the trap. pub trap_code: ir::TrapCode, } diff --git a/crates/lightbeam/wasmtime/src/lib.rs b/crates/lightbeam/wasmtime/src/lib.rs index 599f03bb8114..6ff28f1951e6 100644 --- a/crates/lightbeam/wasmtime/src/lib.rs +++ b/crates/lightbeam/wasmtime/src/lib.rs @@ -165,12 +165,11 @@ impl binemit::TrapSink for TrapSink { fn trap( &mut self, code_offset: binemit::CodeOffset, - source_loc: ir::SourceLoc, + _source_loc: ir::SourceLoc, trap_code: ir::TrapCode, ) { self.traps.push(TrapInformation { code_offset, - source_loc, trap_code, }); }