pub struct Location<'p> {
pub module: &'p Module,
pub func: &'p Function,
pub bb: &'p BasicBlock,
pub instr: BBInstrIndex,
pub source_loc: Option<&'p DebugLoc>,
}
Expand description
Fully describes a code location within the LLVM IR.
Fields§
§module: &'p Module
§func: &'p Function
§bb: &'p BasicBlock
§instr: BBInstrIndex
§source_loc: Option<&'p DebugLoc>
Source location which this IR location corresponds to, if available.
Implementations§
source§impl<'p> Location<'p>
impl<'p> Location<'p>
sourcepub fn to_string_with_module(&self) -> String
pub fn to_string_with_module(&self) -> String
Format this Location
as a string, including the full module name
sourcepub fn to_string_no_module(&self) -> String
pub fn to_string_no_module(&self) -> String
Format this Location
as a string, omitting the module name
sourcepub fn to_string_short_module(&self) -> String
pub fn to_string_short_module(&self) -> String
Format this Location
as a string, including the short module name. The
short module name is the part of the module name after the last /
, if
any; or the full module name, if the module name does not contain a /
.
Trait Implementations§
source§impl<'p> From<Location<'p>> for LocationDescription<'p>
impl<'p> From<Location<'p>> for LocationDescription<'p>
source§fn from(loc: Location<'p>) -> LocationDescription<'_>
fn from(loc: Location<'p>) -> LocationDescription<'_>
Converts to this type from the input type.
source§impl<'p> PartialEq for Location<'p>
impl<'p> PartialEq for Location<'p>
Implementation of PartialEq
assumes that module names are unique;
that function names are unique within a module;
and that bb names are unique within a function
impl<'p> Eq for Location<'p>
Our implementation of PartialEq
satisfies the requirements of Eq
Auto Trait Implementations§
impl<'p> RefUnwindSafe for Location<'p>
impl<'p> Send for Location<'p>
impl<'p> Sync for Location<'p>
impl<'p> Unpin for Location<'p>
impl<'p> UnwindSafe for Location<'p>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more