pub struct Location<'c> { /* private fields */ }Expand description
A location
Implementations§
Source§impl<'c> Location<'c>
impl<'c> Location<'c>
Sourcepub fn new(
context: &'c Context,
filename: &str,
line: usize,
column: usize,
) -> Self
pub fn new( context: &'c Context, filename: &str, line: usize, column: usize, ) -> Self
Creates a location with a filename and line and column numbers.
Sourcepub fn fused(
context: &'c Context,
locations: &[Self],
attribute: Attribute<'_>,
) -> Self
pub fn fused( context: &'c Context, locations: &[Self], attribute: Attribute<'_>, ) -> Self
Creates a fused location.
Sourcepub fn name(context: &'c Context, name: &str, child: Location<'_>) -> Self
pub fn name(context: &'c Context, name: &str, child: Location<'_>) -> Self
Creates a name location.
Sourcepub fn call_site(callee: Location<'_>, caller: Location<'_>) -> Self
pub fn call_site(callee: Location<'_>, caller: Location<'_>) -> Self
Creates a call site location.
Sourcepub fn file_line_col_range(
context: &'c Context,
filename: &str,
start_line: usize,
start_col: usize,
end_line: usize,
end_col: usize,
) -> Self
pub fn file_line_col_range( context: &'c Context, filename: &str, start_line: usize, start_col: usize, end_line: usize, end_col: usize, ) -> Self
Creates a file/line/column range location.
Sourcepub fn context(&self) -> ContextRef<'c>
pub fn context(&self) -> ContextRef<'c>
Returns a context.
Sourcepub fn is_call_site(&self) -> bool
pub fn is_call_site(&self) -> bool
Returns true if this location is a call site location.
Sourcepub fn is_file_line_col_range(&self) -> bool
pub fn is_file_line_col_range(&self) -> bool
Returns true if this location is a file/line/column range location.
Sourcepub fn call_site_callee(&self) -> Self
pub fn call_site_callee(&self) -> Self
Returns the callee of a call site location.
Sourcepub fn call_site_caller(&self) -> Self
pub fn call_site_caller(&self) -> Self
Returns the caller of a call site location.
Sourcepub fn file_line_col_range_filename(&self) -> Identifier<'c>
pub fn file_line_col_range_filename(&self) -> Identifier<'c>
Returns the filename of a file/line/column range location.
Sourcepub fn file_line_col_range_start_line(&self) -> usize
pub fn file_line_col_range_start_line(&self) -> usize
Returns the start line of a file/line/column range location.
Sourcepub fn file_line_col_range_start_column(&self) -> usize
pub fn file_line_col_range_start_column(&self) -> usize
Returns the start column of a file/line/column range location.
Sourcepub fn file_line_col_range_end_line(&self) -> usize
pub fn file_line_col_range_end_line(&self) -> usize
Returns the end line of a file/line/column range location.
Sourcepub fn file_line_col_range_end_column(&self) -> usize
pub fn file_line_col_range_end_column(&self) -> usize
Returns the end column of a file/line/column range location.
Sourcepub fn fused_num_locations(&self) -> usize
pub fn fused_num_locations(&self) -> usize
Returns the number of locations in a fused location.
Sourcepub fn fused_location(&self, index: usize) -> Self
pub fn fused_location(&self, index: usize) -> Self
Returns the location at index in a fused location.
Sourcepub fn fused_metadata(&self) -> Attribute<'c>
pub fn fused_metadata(&self) -> Attribute<'c>
Returns the metadata attribute of a fused location.
Sourcepub fn name_value(&self) -> Identifier<'c>
pub fn name_value(&self) -> Identifier<'c>
Returns the name identifier of a name location.
Sourcepub fn name_child_location(&self) -> Self
pub fn name_child_location(&self) -> Self
Returns the child location of a name location.
Sourcepub fn to_attribute(&self) -> Attribute<'c>
pub fn to_attribute(&self) -> Attribute<'c>
Converts this location to an attribute.
Sourcepub fn from_attribute(attribute: Attribute<'c>) -> Self
pub fn from_attribute(attribute: Attribute<'c>) -> Self
Creates a location from an attribute.
Sourcepub unsafe fn from_raw(raw: MlirLocation) -> Self
pub unsafe fn from_raw(raw: MlirLocation) -> Self
Sourcepub const fn to_raw(self) -> MlirLocation
pub const fn to_raw(self) -> MlirLocation
Converts a location into a raw object.