rustc_mir: support MIR-inlining #[track_caller] functions.
This commit is contained in:
parent
fb36440b7a
commit
6451b39a25
8 changed files with 144 additions and 52 deletions
|
@ -1878,6 +1878,11 @@ pub struct SourceScopeData<'tcx> {
|
|||
/// `ty::Instance` is the callee, and the `Span` is the call site.
|
||||
pub inlined: Option<(ty::Instance<'tcx>, Span)>,
|
||||
|
||||
/// Nearest (transitive) parent scope (if any) which is inlined.
|
||||
/// This is an optimization over walking up `parent_scope`
|
||||
/// until a scope with `inlined: Some(...)` is found.
|
||||
pub inlined_parent_scope: Option<SourceScope>,
|
||||
|
||||
/// Crate-local information for this source scope, that can't (and
|
||||
/// needn't) be tracked across crates.
|
||||
pub local_data: ClearCrossCrate<SourceScopeLocalData>,
|
||||
|
|
|
@ -325,6 +325,7 @@ macro_rules! make_mir_visitor {
|
|||
span,
|
||||
parent_scope,
|
||||
inlined,
|
||||
inlined_parent_scope,
|
||||
local_data: _,
|
||||
} = scope_data;
|
||||
|
||||
|
@ -357,6 +358,9 @@ macro_rules! make_mir_visitor {
|
|||
}
|
||||
self.visit_substs(callee_substs, location);
|
||||
}
|
||||
if let Some(inlined_parent_scope) = inlined_parent_scope {
|
||||
self.visit_source_scope(inlined_parent_scope);
|
||||
}
|
||||
}
|
||||
|
||||
fn super_statement(&mut self,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue