Remove source_loc from TrapInformation (#2325)

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.
This commit is contained in:
Alex Crichton
2020-10-28 13:05:05 -05:00
committed by GitHub
parent a1db0ff6a9
commit 3461ffa563
3 changed files with 2 additions and 6 deletions

View File

@@ -195,12 +195,11 @@ impl binemit::TrapSink for TrapSink {
fn trap( fn trap(
&mut self, &mut self,
code_offset: binemit::CodeOffset, code_offset: binemit::CodeOffset,
source_loc: ir::SourceLoc, _source_loc: ir::SourceLoc,
trap_code: ir::TrapCode, trap_code: ir::TrapCode,
) { ) {
self.traps.push(TrapInformation { self.traps.push(TrapInformation {
code_offset, code_offset,
source_loc,
trap_code, trap_code,
}); });
} }

View File

@@ -61,8 +61,6 @@ pub enum RelocationTarget {
pub struct TrapInformation { pub struct TrapInformation {
/// The offset of the trapping instruction in native code. It is relative to the beginning of the function. /// The offset of the trapping instruction in native code. It is relative to the beginning of the function.
pub code_offset: binemit::CodeOffset, pub code_offset: binemit::CodeOffset,
/// Location of trapping instruction in WebAssembly binary module.
pub source_loc: ir::SourceLoc,
/// Code of the trap. /// Code of the trap.
pub trap_code: ir::TrapCode, pub trap_code: ir::TrapCode,
} }

View File

@@ -165,12 +165,11 @@ impl binemit::TrapSink for TrapSink {
fn trap( fn trap(
&mut self, &mut self,
code_offset: binemit::CodeOffset, code_offset: binemit::CodeOffset,
source_loc: ir::SourceLoc, _source_loc: ir::SourceLoc,
trap_code: ir::TrapCode, trap_code: ir::TrapCode,
) { ) {
self.traps.push(TrapInformation { self.traps.push(TrapInformation {
code_offset, code_offset,
source_loc,
trap_code, trap_code,
}); });
} }