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

Method source_loc_from

winch/codegen/src/codegen/mod.rs:264–270  ·  view source on GitHub ↗

Derives a [RelSourceLoc] from a [SourceLoc].

(&mut self, loc: SourceLoc)

Source from the content-addressed store, hash-verified

262
263 /// Derives a [RelSourceLoc] from a [SourceLoc].
264 pub fn source_loc_from(&mut self, loc: SourceLoc) -> RelSourceLoc {
265 if self.source_location.base.is_none() && !loc.is_default() {
266 self.source_location.base = Some(loc);
267 }
268
269 RelSourceLoc::from_base_offset(self.source_location.base.unwrap_or_default(), loc)
270 }
271
272 /// The following two helpers, handle else or end instructions when the
273 /// compiler has entered into an unreachable code state. These instructions

Callers 1

Calls 2

is_noneMethod · 0.45
is_defaultMethod · 0.45

Tested by

no test coverage detected