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>
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> 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> Freeze for Location<'p>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more