Derives a [RelSourceLoc] from a [SourceLoc].
(&mut self, loc: SourceLoc)
| 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 |
no test coverage detected